/* Self-hosted Inter font faces */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* Reset default spacing and apply consistent sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Set the dark theme background and base typography */
body {
    background: #0f0f0f;
    color: #e4e4e7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    padding: 20px;
}

/* Keep content centered with generous horizontal padding */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Separate the hero block from the table */
header {
    margin-bottom: 48px;
}

/* Style the main page title */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

/* Provide supporting copy under the title */
.subtitle {
    font-size: 1.125rem;
    color: #a1a1aa;
    font-weight: 400;
}

/* Lay out the update metadata in a flexible row */
.meta-info {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Align individual metadata entries */
.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #71717a;
}

/* Highlight the metadata label text */
.meta-item strong {
    color: #a1a1aa;
}

/* Stat Cards Section */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 5px;
    padding: 20px;
    transition: border-color 0.1s ease;
}

.stat-card:hover {
    border-color: #52525b;
}

.stat-label {
    font-size: 0.875rem;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-description {
    font-size: 0.875rem;
    color: #71717a;
}

/* Filters Section */
.filters-section {
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 24px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 0.875rem;
    color: #a1a1aa;
    font-weight: 600;
    margin-bottom: 8px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(39, 39, 42, 0.75);
    color: #e4e4e7;
    border: 1px solid #3f3f46;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
    background: #3f3f46;
    border-color: #52525b;
}

.filter-btn.active {
    background: #5635e6;
    border-color: #5635e6;
    color: #ffffff;
}

/* Best Value Badge */
.best-value-row td:nth-child(2) {
    position: relative;
    padding-right: 110px !important; /* Extra space for the badge */
}

.best-value-row td:nth-child(2)::after {
    content: "Best Value";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 8px;
    background: #22c55e;
    color: #0f0f0f;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* GPU-specific Best Value Badge (Product Name is column 3, not 2) */
.hardware-table--gpu .best-value-row td:nth-child(2) {
    padding-right: 12px !important; /* Reset padding for Brand column */
}

.hardware-table--gpu .best-value-row td:nth-child(2)::after {
    display: none; /* Hide badge from Brand column */
}

.hardware-table--gpu .best-value-row td:nth-child(3) {
    position: relative;
    padding-right: 110px !important; /* Add padding to Product Name column */
}

.hardware-table--gpu .best-value-row td:nth-child(3)::after {
    content: "Best Value";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 8px;
    background: #22c55e;
    color: #0f0f0f;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* House the pricing table within a card */
.table-wrapper {
    overflow-x: auto;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 5px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Apply consistent sizing to the data tables */
.hardware-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

/* Add a divider line under table headers */
.hardware-table thead {
    border-bottom: 2px solid #27272a;
}

/* Style column headings for readability */
.hardware-table th {
    text-align: left;
    padding: 16px 12px;
    font-weight: 600;
    color: #fafafa;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Make sortable headers interactive */
.hardware-table th.sortable {
    cursor: pointer;
    user-select: none;
}

/* Style the sort indicator arrow */
.hardware-table th .sort-indicator {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #a1a1aa;
}

/* Give each table row a subtle divider */
.hardware-table tbody tr {
    border-bottom: 1px solid #27272a;
    transition: background-color 0.1s ease;
}

/* Darken rows on hover for clarity */
.hardware-table tbody tr:hover {
    background: #27272a;
}

/* Remove the bottom border from the final row */
.hardware-table tbody tr:last-child {
    border-bottom: none;
}

/* Pad table cells for breathing room */
.hardware-table td {
    padding: 16px 12px;
    color: #e4e4e7;
}

/* Use tabular numbers in key numeric columns for SSDs */
.hardware-table--ssd td:nth-child(3),
.hardware-table--ssd td:nth-child(6),
.hardware-table--ssd td:nth-child(7),
.hardware-table--ssd td:nth-child(8) {
    font-variant-numeric: tabular-nums;
}

/* Use tabular numbers in key numeric columns for HDDs */
.hardware-table--hdd td:nth-child(3),
.hardware-table--hdd td:nth-child(6),
.hardware-table--hdd td:nth-child(7) {
    font-variant-numeric: tabular-nums;
}

/* Use tabular numbers in key numeric columns for GPUs */
.hardware-table--gpu td:nth-child(4),
.hardware-table--gpu td:nth-child(5),
.hardware-table--gpu td:nth-child(6),
.hardware-table--gpu td:nth-child(7),
.hardware-table--gpu td:nth-child(8) {
    font-variant-numeric: tabular-nums;
}

/* Emphasise the price-per-terabyte figure */
.hardware-table .price-per-tb {
    font-weight: 600;
    color: #22c55e;
}

/* Emphasise the price-per-score figure */
.hardware-table .price-per-score {
    font-weight: 600;
    color: #22c55e;
}

/* Shared styling for price columns */
.hardware-table .price-amount {
    font-weight: 600;
}

/* Button styling for the Amazon link */
.amazon-link {
    display: inline-block;
    padding: 6px 16px;
    background: #5635e6;
    color: #ffffff; /* keep text fully bright */
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.1s ease, box-shadow 0.1s ease;
}

/* Brighten just the background on hover (text stays white) */
.amazon-link:hover {
    background: #6b4bf8;
    color: #ffffff;
}

/* Shared button styling for page navigation */
.button-link {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(39, 39, 42, 0.75);
    color: #e4e4e7;
    text-decoration: none;
    border: 1px solid #3f3f46;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.1s ease, border-color 0.1s ease;
}

.button-link:hover {
    background: #3f3f46;
    border-color: #52525b;
}

.page-actions {
    margin-bottom: 24px;
}

/* Set footer spacing and tone */
footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #27272a;
    text-align: center;
    color: #71717a;
    font-size: 0.875rem;
}

/* Space footer copy */
footer p {
    margin-bottom: 8px;
}

/* Style footer links */
footer a {
    color: #a1a1aa;
    text-decoration: none;
}

/* Lighten footer links when hovered */
footer a:hover {
    color: #e4e4e7;
}

/* Home page specific helpers */
.container--home {
    max-width: 600px;
    text-align: center;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card {
    background: #18181b;
    padding: 24px;
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
    transition: all 0.1s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    background: #27272a;
    border-color: #6b4bf8;
    transform: translateY(-2px);
}

.category-card h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #ffffff;
}

.category-card p {
    color: #a1a1aa;
    font-size: 0.9375rem;
}

.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon:hover {
    transform: none;
    border-color: transparent;
    background: #18181b;
}

.badge {
    display: inline-block;
    background: #22c55e;
    color: #0f0f0f;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Home page vertical centering */
body.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Home page spacing */
body.home .subtitle {
    margin-bottom: 24px;
}

body.home .categories {
    margin-bottom: 12px;
}

body.home footer {
    margin-top: 24px;
}

/* Readable links inside content cards (exclude buttons) */
.table-wrapper a:not(.amazon-link) {
    color: #a1a1aa;
    text-decoration: none;
}

.table-wrapper a:not(.amazon-link):hover {
    color: #e4e4e7;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .container {
        padding: 24px 12px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .filters-section {
        padding: 16px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    .table-wrapper {
        padding: 16px;
        border: 1px solid #3f3f46;
    }

    .hardware-table th,
    .hardware-table td {
        padding: 12px 8px;
        font-size: 0.875rem;
    }

    .hardware-table th {
        font-size: 0.75rem;
    }

    .amazon-link {
        padding: 4px 12px;
        font-size: 0.8125rem;
    }

    .best-value-row td:nth-child(2) {
        padding-right: 12px !important; /* Reset padding on mobile */
    }

    .best-value-row td:nth-child(2)::after {
        position: static;
        transform: none;
        display: block;
        margin-left: 0;
        margin-top: 4px;
        width: fit-content;
    }
}
