/* Cards Page Styles */

/* Navigation - Ensure consistent with other pages */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--background-white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 40px;
    width: auto;
}

.tagline {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid var(--primary-light);
    color: var(--text-light);
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Mobile hamburger menu override - REQUIRED per docs/solutions */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    nav.nav-open .nav-links {
        display: flex;
    }
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* Header Section */
.cards-header {
    padding: 8rem 5% 3rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    text-align: center;
    color: white;
}

.cards-header h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    color: var(--neutral-100);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.cards-header .subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
}

/* Category Quick Navigation */
.category-nav {
    background: var(--background-white);
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: var(--nav-height, 84px);
    z-index: 100;
    padding: 1rem 5%;
    transition: top 0.3s ease;
}

/* Offset category nav and scroll targets when compare bar is visible */
.compare-bar-active .category-nav {
    top: calc(var(--nav-height, 84px) + 50px);
}
.compare-bar-active .category {
    scroll-margin-top: calc(var(--nav-height, 84px) + 50px + 76px);
}

.category-nav .container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav .container::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: var(--neutral-100);
    border-radius: 2rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-nav a:hover {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
.cards-content {
    padding: 2rem 5%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Category Sections */
.category {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--neutral-200);
    scroll-margin-top: calc(var(--nav-height, 84px) + 76px);
}

.category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.category-intro {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.category-ranking-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.category-ranking-link:hover {
    text-decoration: underline;
}

/* Card List */
.card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.card-list li {
    padding: 1rem;
    background: var(--neutral-50);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.card-list li:last-child {
    margin-bottom: 0;
}

.card-list strong {
    color: var(--text-color);
    font-size: 1.05rem;
}

.card-details {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Toggle slider for card comparison */
.card-list .compare-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.card-list .compare-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-list .toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--neutral-300);
    border-radius: 10px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.card-list .toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.card-list .compare-toggle input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.card-list .compare-toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.card-list .toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-600);
}

.card-list .compare-toggle input:checked ~ .toggle-label {
    color: var(--primary-color);
}

.card-list .compare-toggle:hover .toggle-slider {
    background-color: var(--neutral-400);
}

.card-list .compare-toggle input:checked + .toggle-slider:hover {
    background-color: var(--primary-dark, #004A45);
}

.card-list .compare-toggle input:focus-visible + .toggle-slider {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Popular Comparisons */
.popular-comparisons {
    margin-top: 1.5rem;
}

.popular-comparisons h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.popular-comparisons a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.popular-comparisons a:hover {
    background: var(--primary-color);
    color: white;
}

/* CTA Section */
.cards-cta {
    padding: 4rem 5%;
    background: var(--neutral-100);
    text-align: center;
}

.cards-cta h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.cards-cta p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.cards-cta .cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.2s ease;
}

.cards-cta .cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Footer styling */
footer {
    padding: 3rem 5% 2rem;
    background: var(--text-color);
    color: white;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.disclaimer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    line-height: 1.6;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cards-header h1 {
        font-size: 2rem;
    }

    .cards-header .subtitle {
        font-size: 1.1rem;
    }

    /* category-nav and scroll-margin-top handled by --nav-height variable */

    .category h2 {
        font-size: 1.5rem;
    }

    .category-intro {
        font-size: 1rem;
    }

    .card-list li {
        padding: 0.875rem;
    }

    .card-list strong {
        font-size: 1rem;
    }

    .card-list .toggle-label {
        display: none;
    }

    .popular-comparisons a {
        display: block;
        margin-right: 0;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cards-header {
        padding: 6rem 5% 2rem;
    }

    .cards-header h1 {
        font-size: 1.75rem;
    }

    .category-nav a {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .cards-content {
        padding: 1.5rem 5%;
    }

    .category {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}
