/* =========================================================
   VIKING RISE SINGULARITY
   EQUIPMENT
   ========================================================= */


/* =========================================================
   CATEGORY LANDING
   ========================================================= */

.gear-section {
    width: 100%;
}

.gear-category-view {
    width: 100%;
}

.gear-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}


/* =========================================================
   CATEGORY CARDS
   ========================================================= */

.gear-category-card {
    position: relative;
    display: flex;
    align-items: flex-end;

    min-height: 260px;
    padding: 30px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface);

    cursor: pointer;
    overflow: hidden;
    outline: none;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.gear-category-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.45),
            transparent 65%
        );

    pointer-events: none;
}

.gear-category-card:hover,
.gear-category-card:focus-visible {
    border-color: var(--border-red);
    background: var(--surface-light);
    transform: translateY(-3px);
}

.gear-category-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.gear-category-label {
    display: inline-flex;

    margin-bottom: 12px;
    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 5px;

    color: var(--text-muted);

    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gear-category-card h3 {
    margin: 0;

    color: var(--text);

    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.2;
}

.gear-category-card p {
    max-width: 300px;

    margin: 10px 0 0;

    color: var(--text-muted);

    font-size: 0.78rem;
    line-height: 1.6;
}

.gear-category-action {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 24px;

    color: var(--text-muted);

    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gear-category-action span {
    color: var(--red-light);
    font-size: 0.95rem;

    transition: transform 0.2s ease;
}

.gear-category-card:hover .gear-category-action span {
    transform: translateX(3px);
}


/* =========================================================
   DATABASE VIEW
   ========================================================= */

.gear-database-view {
    width: 100%;
}

.gear-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 28px;
    padding: 10px 14px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface);
    color: var(--text-muted);

    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}

.gear-back-button:hover {
    border-color: var(--border-red);
    background: var(--surface-light);
    color: var(--text);
}

.gear-database-header {
    margin-bottom: 28px;
    padding-bottom: 24px;

    border-bottom: 1px solid var(--border);
}

.gear-database-header h2 {
    margin: 0;

    color: var(--text);

    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 900;
    line-height: 1.2;
}

.gear-database-header p {
    margin: 10px 0 0;

    color: var(--text-muted);

    font-size: 0.8rem;
    line-height: 1.6;
}


/* =========================================================
   SEARCH AND FILTERS
   ========================================================= */

.gear-database-view .database-controls {
    display: flex;
    align-items: center;

    width: 100%;

    margin-bottom: 30px;

    gap: 60px;
}


/* =========================================================
   EQUIPMENT SEARCH
   ========================================================= */

.gear-database-view .search-wrapper {
    width: 40%;
    flex: 0 0 40%;
}


.gear-database-view .filter-group {
    width: 100%;
    flex-direction: column;
    gap: 12px;
    margin-left: 0;
}


#gearSearch {
    width: 100%;
    min-width: 0;

    padding: 13px 16px;

    border: 1px solid var(--border);
    border-radius: 6px;

    outline: none;

    background: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 0.85rem;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


#gearSearch::placeholder {
    color: var(--text-muted);
}


#gearSearch:focus {
    border-color: var(--border-red);
    background: var(--surface-light);
}


#gearTypeFilter,
#gearTroopFilter {
    width: 145px;
    flex: 0 0 145px;

    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 6px;

    outline: none;

    background: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 800;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


#gearTypeFilter:focus,
#gearTroopFilter:focus {
    border-color: var(--border-red);
}

/* =========================================================
   EQUIPMENT GRID
   ========================================================= */

.gear-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;

    width: 100%;
}


/* =========================================================
   EQUIPMENT CARD
   ========================================================= */

.gear-card {
    position: relative;

    min-width: 0;
    padding: 24px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface);

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.gear-card:hover {
    border-color: var(--border-red);
    background: var(--surface-light);
}


/* =========================================================
   EQUIPMENT IMAGE
   ========================================================= */

.gear-card-image {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 170px;

    margin-bottom: 20px;

    border-bottom: 1px solid var(--border);
}

.gear-card-image img {
    display: block;

    max-width: 150px;
    max-height: 150px;

    width: auto;
    height: auto;

    object-fit: contain;

    filter:
        drop-shadow(
            0 8px 18px rgba(0, 0, 0, 0.35)
        );

    transition: transform 0.25s ease;
}

.gear-card:hover .gear-card-image img {
    transform: scale(1.04);
}


/* =========================================================
   EQUIPMENT HEADER
   ========================================================= */

.gear-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 20px;
}

.gear-card-category {
    display: inline-flex;

    margin-bottom: 7px;

    color: var(--text-muted);

    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gear-card h3 {
    margin: 0;

    color: var(--text);

    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.3;
}

.gear-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 5px;

    flex: 0 0 auto;
}

.gear-card-meta span {
    color: var(--red-light);

    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    white-space: nowrap;
}


/* =========================================================
   STAT TABLE
   ========================================================= */

.gear-card-stats {
    width: 100%;
}

.gear-table-wrapper {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 6px;

    overflow: hidden;
}

.gear-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;
}

.gear-table th,
.gear-table td {
    padding: 10px 7px;

    border-bottom: 1px solid var(--border);

    text-align: center;

    white-space: normal;

    overflow-wrap: break-word;
}

.gear-table th:first-child,
.gear-table td:first-child {
    width: 25%;

    color: var(--text);

    font-weight: 700;
}

.gear-table th {
    background: rgba(255, 255, 255, 0.018);

    color: var(--text-muted);

    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.gear-table td {
    color: var(--red-light);

    font-size: 0.73rem;
    font-weight: 800;
}

.gear-table td:first-child {
    min-width: 150px;

    color: var(--text);

    font-weight: 700;
}

.gear-table tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   EMPTY / ERROR
   ========================================================= */

.database-empty,
.database-error {
    grid-column: 1 / -1;

    padding: 50px 30px;

    border: 1px solid var(--border);
    border-radius: 8px;

    text-align: center;
}

.database-empty h3,
.database-error h3 {
    margin: 0 0 8px;

    color: var(--text);

    font-size: 1rem;
    font-weight: 900;
}

.database-empty p,
.database-error p {
    margin: 0;

    color: var(--text-muted);

    font-size: 0.78rem;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .gear-category-grid {
        grid-template-columns: 1fr;
    }

    .gear-category-card {
        min-height: 220px;
    }

}


@media (max-width: 900px) {

    .gear-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .gear-database-view .database-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    }

    #gearSearch,
    #gearTypeFilter,
    #gearTroopFilter {
        width: 100%;
    }

    .gear-card {
        padding: 20px;
    }

    .gear-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .gear-card-meta {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    .gear-card-image {
        height: 150px;
    }

    .gear-card-image img {
        max-width: 125px;
        max-height: 125px;
    }

}


@media (max-width: 500px) {

    .gear-category-card {
        min-height: 200px;
        padding: 24px;
    }

    .gear-category-card h3 {
        font-size: 1.25rem;
    }

    .gear-table th,
    .gear-table td {
        padding: 9px 8px;
    }

}