/* ============================================
   ARMORY FULL REDESIGN
   ============================================ */

/* Disable tap highlight on mobile */
.changelog-accordion,
.changelog-accordion *,
.changelog-table-wrap,
.changelog-table-wrap *,
.weapon-changelog,
.weapon-changelog *,
.sections,
.sections * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Global positive/negative colors */
.positive {
    color: #4CAF50 !important;
    font-weight: 600;
}

.negative {
    color: #f44336 !important;
    font-weight: 600;
}

/* Row highlighting for changelog */
tr.row-positive {
    background: rgba(76, 175, 80, 0.08) !important;
}

tr.row-negative {
    background: rgba(244, 67, 54, 0.08) !important;
}

@media (hover: hover) {
    tr.row-positive:hover {
        background: rgba(76, 175, 80, 0.15) !important;
    }

    tr.row-negative:hover {
        background: rgba(244, 67, 54, 0.15) !important;
    }
}

/* ============================================
   CHANGELOG ACCORDION
   ============================================ */
.changelog-accordion {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.changelog-accordion__input {
    display: none;
}

.changelog-accordion__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(40, 40, 45, 0.9), rgba(30, 30, 35, 0.95));
    border: 1px solid rgba(255, 68, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .changelog-accordion__header:hover {
        background: linear-gradient(135deg, rgba(50, 50, 55, 0.9), rgba(40, 40, 45, 0.95));
        border-color: rgba(255, 68, 0, 0.5);
    }
}

.changelog-accordion__icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.changelog-accordion__icon::before,
.changelog-accordion__icon::after {
    content: '';
    position: absolute;
    background: #F40;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.changelog-accordion__icon::before {
    width: 100%;
    height: 3px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.changelog-accordion__icon::after {
    width: 3px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.changelog-accordion__input:checked + .changelog-accordion__header .changelog-accordion__icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

.changelog-accordion__title {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.changelog-accordion__hint {
    font-size: 0.8em;
    color: #888;
    transition: opacity 0.2s;
}

.changelog-accordion__input:checked + .changelog-accordion__header .changelog-accordion__hint {
    opacity: 0;
}

.changelog-accordion__content {
    display: none;
    margin-top: -1px;
    padding: 0;
    background: rgba(25, 25, 30, 0.95);
    border: 1px solid rgba(255, 68, 0, 0.2);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 400px;
    overflow-y: auto;
}

.changelog-accordion__input:checked ~ .changelog-accordion__content {
    display: block;
}

.changelog-accordion__input:checked + .changelog-accordion__header {
    border-radius: 10px 10px 0 0;
    border-color: rgba(255, 68, 0, 0.4);
}

/* Changelog table inside accordion */
.changelog-table-wrap {
    overflow-x: hidden;
}

.changelog-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.changelog-table-wrap th,
.changelog-table-wrap td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Column widths for main changelog */
.changelog-table-wrap th:nth-child(1),
.changelog-table-wrap td:nth-child(1) { width: 25%; } /* Weapon */
.changelog-table-wrap th:nth-child(2),
.changelog-table-wrap td:nth-child(2) { width: 30%; } /* Parameter */
.changelog-table-wrap th:nth-child(3),
.changelog-table-wrap td:nth-child(3) { width: 15%; } /* Old */
.changelog-table-wrap th:nth-child(4),
.changelog-table-wrap td:nth-child(4) { width: 15%; } /* New */
.changelog-table-wrap th:nth-child(5),
.changelog-table-wrap td:nth-child(5) { width: 15%; } /* Change */

.changelog-table-wrap th {
    background: rgba(255, 68, 0, 0.1);
    color: #F40;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

@media (hover: hover) {
    .changelog-table-wrap tr:hover td {
        background: rgba(255, 68, 0, 0.05);
    }
}

.changelog-table-wrap .positive {
    color: #4CAF50;
    font-weight: 600;
}

.changelog-table-wrap .negative {
    color: #f44336;
    font-weight: 600;
}

.changelog-table-wrap td a {
    color: #F40;
}

@media (hover: hover) {
    .changelog-table-wrap td a:hover {
        color: #FF6B00;
    }
}


@media (max-width: 768px) {
    .changelog-accordion__header {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .changelog-accordion__title {
        font-size: 0.9em;
    }
    
    .changelog-accordion__hint {
        display: none;
    }
    
    .changelog-accordion__content {
        max-height: 500px;
    }
}

/* ============================================
   CATEGORY NAVIGATION
   ============================================ */
.sections {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px auto;
    padding: 0 15px;
}

.sections > a,
.sections label {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 0.95em;
    color: #aaa;
    background: rgba(40, 40, 45, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0;
}

@media (hover: hover) {
    .sections > a:hover,
    .sections label:hover {
        color: #fff;
        background: rgba(60, 60, 65, 0.9);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

.sections > a.active {
    color: #fff !important;
    background: rgba(255, 68, 0, 0.2) !important;
    border-color: #F40 !important;
    border-bottom: 2px solid #F40 !important;
}

/* ============================================
   WEAPONS GRID
   ============================================ */
.armory-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Weapon card */
.armory-items .item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 180px !important;
    margin: 0 !important;
    padding: 15px 15px 45px;
    background: linear-gradient(180deg, rgba(35, 35, 40, 0.95) 0%, rgba(25, 25, 30, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    transition: all 0.25s ease;
    cursor: pointer;
}

@media (hover: hover) {
    .armory-items .item:hover {
        border-color: rgba(255, 68, 0, 0.5);
        background: linear-gradient(180deg, rgba(45, 45, 50, 0.95) 0%, rgba(30, 30, 35, 0.98) 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }
}

/* Picture container - FIXED SIZE, centered image */
.armory-items .item .picture {
    width: 200px !important;
    height: 100px !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
}

/* Weapon name */
.armory-items .item .name {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 12px 15px !important;
    margin: 0;
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
    color: #fff;
    background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    border-radius: 0 0 12px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   PAGINATION - FULL WIDTH in grid
   ============================================ */
ul.cryproxy-pages {
    grid-column: 1 / -1; /* Span all columns! */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
    margin: 0;
    list-style: none;
    width: 100%;
}

ul.cryproxy-pages li {
    border: none !important;
    border-radius: 8px !important;
    background: rgba(50, 50, 55, 0.8);
    overflow: hidden;
    transition: all 0.2s ease;
}

ul.cryproxy-pages li:first-child,
ul.cryproxy-pages li:last-child {
    border-radius: 8px !important;
}

ul.cryproxy-pages li a,
ul.cryproxy-pages li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 10px 14px !important;
    line-height: 1 !important;
    font-size: 14px;
    color: #bbb;
    text-decoration: none;
}

@media (hover: hover) {
    ul.cryproxy-pages li:hover {
        background: rgba(255, 68, 0, 0.25);
    }

    ul.cryproxy-pages li:hover a {
        color: #fff;
    }
}

ul.cryproxy-pages li.active {
    background: #F40;
}

ul.cryproxy-pages li.active span {
    color: #fff;
    font-weight: 600;
}

/* ============================================
   MOBILE STYLES
   ============================================ */
@media (max-width: 900px) {
    /* Navigation scroll */
    .sections {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 15px;
        gap: 8px;
        margin: 10px 0;
    }
    
    .sections::-webkit-scrollbar {
        display: none;
    }
    
    .sections > a,
    .sections label {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.85em;
        white-space: nowrap;
    }
    
    /* Weapons - ONE per row */
    .armory-items {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px 20px;
    }
    
    .armory-items .item {
        flex-direction: row;
        height: auto !important;
        min-height: 80px;
        padding: 10px 15px;
        gap: 15px;
        justify-content: flex-start;
    }
    
    .armory-items .item .picture {
        width: 140px !important;
        height: 70px !important;
        flex-shrink: 0;
    }
    
    .armory-items .item .name {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        padding: 0 !important;
        background: none !important;
        text-align: left;
        font-size: 0.95em;
        white-space: normal;
        overflow: visible;
        flex: 1;
        display: flex;
        align-items: center;
    }
    
    /* Pagination */
    ul.cryproxy-pages {
        padding: 15px 0;
    }
}

@media (max-width: 500px) {
    .sections > a,
    .sections label {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .armory-items .item {
        min-height: 70px;
        padding: 8px 12px;
        gap: 12px;
    }
    
    .armory-items .item .picture {
        width: 110px !important;
        height: 55px !important;
    }
    
    .armory-items .item .name {
        font-size: 0.9em;
    }
    
    ul.cryproxy-pages li a,
    ul.cryproxy-pages li span {
        min-width: 36px;
        padding: 8px 10px !important;
        font-size: 13px;
    }
}

/* ============================================
   WEAPON DETAIL PAGE
   ============================================ */

/* Weapon image - fixed size container */
.parameters .item-picture {
    width: 280px !important;
    height: 140px !important;
    margin: 20px auto !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Desktop: Graphics RIGHT, table LEFT - side by side */
.parameters .graphics {
    float: right !important;
    width: 280px !important;
    margin-left: 30px !important;
    margin-bottom: 20px;
}

table.parameters-list {
    width: calc(100% - 320px) !important; /* 850px - 280px(graphics) - 30px(margin) - 10px(buffer) */
    overflow: hidden;
}

/* Weapon changelog on detail page */
.weapon-changelog {
    clear: both;
    margin-top: 30px;
}

.weapon-changelog h1 {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.weapon-changelog .wfts-table {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(25, 25, 30, 0.8);
}

.weapon-changelog .wfts-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.weapon-changelog .wfts-table th,
.weapon-changelog .wfts-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Column widths for weapon changelog */
.weapon-changelog .wfts-table th:nth-child(1),
.weapon-changelog .wfts-table td:nth-child(1) { width: 12%; } /* Version */
.weapon-changelog .wfts-table th:nth-child(2),
.weapon-changelog .wfts-table td:nth-child(2) { width: 40%; } /* Parameter */
.weapon-changelog .wfts-table th:nth-child(3),
.weapon-changelog .wfts-table td:nth-child(3) { width: 16%; } /* Old */
.weapon-changelog .wfts-table th:nth-child(4),
.weapon-changelog .wfts-table td:nth-child(4) { width: 16%; } /* New */
.weapon-changelog .wfts-table th:nth-child(5),
.weapon-changelog .wfts-table td:nth-child(5) { width: 16%; } /* Change */

.weapon-changelog .wfts-table th {
    background: rgba(255, 68, 0, 0.1);
    color: #F40;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

.weapon-changelog .wfts-table .positive,
.weapon-changelog .positive {
    color: #4CAF50 !important;
    font-weight: 600;
}

.weapon-changelog .wfts-table .negative,
.weapon-changelog .negative {
    color: #f44336 !important;
    font-weight: 600;
}

.weapon-changelog .wfts-table td a {
    color: #F40;
}

@media (max-width: 900px) {
    .parameters {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box;
    }
    
    .parameters .item-picture {
        width: 100% !important;
        max-width: 280px !important;
        height: 120px !important;
    }
    
    .parameters .graphics {
        float: none !important;
        width: 100% !important;
        max-width: 280px !important;
        margin: 0 auto 20px !important;
    }
    
    .parameters .graphics .hitbox {
        width: 200px;
        height: 340px;
        background-size: contain !important;
        margin: 0 auto;
    }
    
    .parameters .graphics .class-picture {
        display: none;
    }
    
    .hitbox .head { top: 3px; right: 5px; }
    .hitbox .body { top: 48px; left: 5px; }
    .hitbox .arms { top: 200px; right: 5px; }
    .hitbox .legs { top: 268px; left: 7px; }
    
    table.parameters-list {
        width: 100%;
    }
    
    table.parameters-list td {
        padding: 8px 5px;
        font-size: 0.9em;
    }
    
    /* Weapon changelog mobile - card layout */
    .weapon-changelog .wfts-table {
        max-height: 400px;
    }
    
    .weapon-changelog .wfts-table thead {
        display: none;
    }
    
    .weapon-changelog .wfts-table table {
        display: block;
    }
    
    .weapon-changelog .wfts-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }
    
    .weapon-changelog .wfts-table tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 2px 8px;
        padding: 12px;
        background: rgba(30, 30, 35, 0.7);
        border-radius: 8px;
        border-left: 3px solid #F40;
    }
    
    /* Row highlighting on mobile */
    .weapon-changelog .wfts-table tr.row-positive {
        background: rgba(76, 175, 80, 0.15) !important;
        border-left-color: #4CAF50;
    }
    
    .weapon-changelog .wfts-table tr.row-negative {
        background: rgba(244, 67, 54, 0.15) !important;
        border-left-color: #f44336;
    }
    
    .weapon-changelog .wfts-table td {
        padding: 0 !important;
        border: none !important;
        font-size: 0.9em;
    }
    
    /* Version - top left */
    .weapon-changelog .wfts-table td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-weight: 700;
        color: #F40;
        font-size: 1.1em;
    }
    
    /* Parameter Name - top right (spans remaining columns) */
    .weapon-changelog .wfts-table td:nth-child(2) {
        grid-column: 2 / -1;
        grid-row: 1;
        color: #fff;
        font-size: 0.95em;
        font-weight: 500;
        text-align: right;
    }
    
    /* Old value - second row */
    .weapon-changelog .wfts-table td:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
        color: #888;
        margin-top: 6px;
    }
    
    .weapon-changelog .wfts-table td:nth-child(3)::after {
        content: ' →';
        color: #F40;
        margin-left: 4px;
    }
    
    /* New value - same row as old */
    .weapon-changelog .wfts-table td:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        color: #fff;
        font-weight: 600;
        margin-top: 6px;
    }
    
    /* Change (delta) - show with color */
    .weapon-changelog .wfts-table td:nth-child(5) {
        grid-column: 3;
        grid-row: 2;
        text-align: right;
        margin-top: 6px;
        font-weight: 600;
    }
}

/* ============================================
   SEARCH BOX
   ============================================ */
@media (max-width: 768px) {
    .search-container {
        width: 95% !important;
    }
    
    .search-container input[type="text"] {
        max-width: 100% !important;
        font-size: 16px;
    }
}

/* ============================================
   CHANGELOG TABLE (main armory page - mobile)
   ============================================ */
@media (max-width: 768px) {
    .changelog-table-wrap {
        overflow-x: hidden;
    }
    
    .changelog-table-wrap table.useractions {
        display: block;
        width: 100%;
    }
    
    .changelog-table-wrap table.useractions thead {
        display: none;
    }
    
    .changelog-table-wrap table.useractions tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }
    
    .changelog-table-wrap table.useractions tr {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 12px 14px;
        background: rgba(30, 30, 35, 0.7);
        border-radius: 8px;
        border-left: 3px solid #F40;
    }
    
    /* Row highlighting on mobile accordion */
    .changelog-table-wrap table.useractions tr.row-positive {
        background: rgba(76, 175, 80, 0.15) !important;
        border-left-color: #4CAF50;
    }
    
    .changelog-table-wrap table.useractions tr.row-negative {
        background: rgba(244, 67, 54, 0.15) !important;
        border-left-color: #f44336;
    }
    
    .changelog-table-wrap table.useractions td {
        display: block;
        padding: 0 !important;
        border: none !important;
        font-size: 0.9em;
        width: 100% !important;
    }
    
    /* Weapon Name - first line */
    .changelog-table-wrap table.useractions td:nth-child(1) {
        font-weight: 600;
        font-size: 1em;
        color: #F40;
        margin-bottom: 2px;
    }
    
    .changelog-table-wrap table.useractions td:nth-child(1) a {
        color: #F40;
        text-decoration: none;
    }
    
    /* Parameter Name - second line */
    .changelog-table-wrap table.useractions td:nth-child(2) {
        color: #fff;
        font-size: 0.95em;
        font-weight: 500;
    }
    
    /* Values row container */
    .changelog-table-wrap table.useractions td:nth-child(3),
    .changelog-table-wrap table.useractions td:nth-child(4) {
        display: inline;
        color: #aaa;
        font-size: 0.85em;
    }
    
    /* Old value */
    .changelog-table-wrap table.useractions td:nth-child(3)::after {
        content: ' → ';
        color: #F40;
    }
    
    /* New value */
    .changelog-table-wrap table.useractions td:nth-child(4) {
        color: #fff;
        font-weight: 600;
    }
    
    /* Change/Delta - hidden on mobile */
    .changelog-table-wrap table.useractions td:nth-child(5) {
        display: none !important;
    }
}

/* ============================================
   MODS
   ============================================ */
@media (max-width: 768px) {
    .mod-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
    }
}

/* ============================================
   FIX OVERFLOW
   ============================================ */
.content-inner {
    overflow-x: hidden;
}
