﻿/* ========================================
   Home Page Styles - Main layout
   ========================================

/* Main layout */
main {
    background: transparent;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: var(--primary-gradient);
    color: var(--white);
    text-align: center;
    padding: var(--space-4xl) var(--space-lg);
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2xl);
    opacity: 0.95;
}

.hero-cta {
    background: var(--white);
    color: var(--primary);
    border: none;
    padding: var(--space-lg) var(--space-4xl);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-in-out);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: var(--font-main);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.hero-stats {
    margin-top: var(--space-2xl);
    font-size: var(--text-base);
    opacity: 0.9;
}

.hero-stats strong {
    font-weight: var(--font-bold);
    color: var(--accent-yellow);
}

/* ========================================
   Featured Carousel Section
   ======================================== */
.featured-section {
    padding: var(--space-4xl) 0;
    background: var(--bg-main);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
}

.carousel-wrapper {
    display: flex;
    transition: transform var(--duration-slower) var(--ease-in-out);
}

.carousel-slide {
    min-width: 100%;
    padding: 0 var(--space-md);
}

.featured-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--duration-slow) var(--ease-out);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.featured-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: var(--space-xl);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Featured badges layout */
.featured-badges {
    position: absolute;
    top: var(--space-md);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-md);
    pointer-events: none;
    z-index: 10;
}

.badges-left,
.badges-right {
    display: flex;
    gap: var(--space-xs);
}

.featured-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.featured-badge.badge-popular {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
}

.featured-badge.badge-new {
    background: linear-gradient(135deg, var(--accent-green), #4caf50);
}

.featured-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.featured-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.featured-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-lg);
    flex: 1;
}

.featured-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Carousel Controls */
.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.carousel-arrow {
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    font-size: var(--text-xl);
}

.carousel-arrow:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-indicators {
    display: flex;
    gap: var(--space-sm);
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    padding: 0;
}

.carousel-indicator.active {
    background: var(--primary);
    width: 32px;
}

/* ========================================
   Category Tabs
   ======================================== */
.category-section {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0px;
    z-index: 900;
    box-shadow: var(--shadow-sm);
    overflow-x: hidden;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    font-family: var(--font-main);
    flex-shrink: 0;
}

.category-tab:hover {
    color: var(--primary);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.category-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========================================
   Test Cards Grid
   ======================================== */
.tests-section {
    padding: var(--space-4xl) 0;
    background: var(--bg-secondary);
    min-height: 60vh;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.test-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--duration-slow) var(--ease-out);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Featured image height: 200px ~ 240px */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slower) var(--ease-out);
}

.test-card:hover .card-image {
    transform: scale(1.05);
}

/* Badge positioning */
.card-badges {
    position: absolute;
    top: var(--space-md);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-md);
    pointer-events: none;
    z-index: 10;
}

.card-badges .badges-left,
.card-badges .badges-right {
    display: flex;
    gap: var(--space-xs);
}

.card-badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-popular {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
}

.badge-new {
    background: linear-gradient(135deg, var(--accent-green), #4caf50);
}

/* Adjust content padding */
.card-content {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: var(--text-xs);
    color: var(--primary);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-xs);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--leading-tight);
}

.card-subtitle {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.card-description {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-md);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: var(--space-4xl);
}

.loading-spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-4xl);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.empty-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.empty-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* ========================================
   Statistics Section - 2 columns
   ======================================== */
.statistics-section {
    background: var(--bg-secondary);
    padding: var(--space-4xl) 0;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.stats-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-2xl);
}

.stat-item {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-4xl) 0;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.cta-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-lg);
    line-height: var(--leading-tight);
}

.cta-subtitle {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2xl);
    opacity: 0.95;
}

.cta-button {
    background: var(--white);
    color: var(--primary);
    border: none;
    padding: var(--space-lg) var(--space-4xl);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-in-out);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: var(--font-main);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .tests-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Large (640px - 767px) */
@media (max-width: 767px) {
    .hero {
        padding: var(--space-3xl) var(--space-lg);
        min-height: 40vh;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    /* Mobile devices: display 2 columns */
    .tests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .category-tabs {
        gap: var(--space-sm);
        padding: var(--space-md);
    }

    .category-section {
        top: 0px;
    }

    /* Mobile: featured image sizing */
    .card-image-wrapper {
        height: 200px;
    }

    /* Mobile: content padding */
    .card-content {
        padding: var(--space-md);
    }

    .card-title {
        font-size: var(--text-base);
        margin-bottom: var(--space-xs);
    }

    .card-subtitle {
        font-size: 0.75rem;
        margin-bottom: var(--space-xs);
    }

    .card-description {
        font-size: 0.7rem;
        margin-bottom: var(--space-sm);
        -webkit-line-clamp: 2;
    }

    .card-meta {
        font-size: 0.7rem;
    }

    /* Featured carousel height */
    .featured-image-wrapper {
        height: 200px;
    }

    /* Single column layout */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: var(--space-xl);
    }
}

/* Mobile Small (0 - 639px) */
@media (max-width: 639px) {
    .hero {
        padding: var(--space-2xl) var(--space-md);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .hero-cta {
        padding: var(--space-md) var(--space-2xl);
        font-size: var(--text-base);
    }

    /* Mobile Small: adjust margins */
    .tests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        padding: 0 var(--space-md);
    }

    .featured-section,
    .tests-section,
    .statistics-section {
        padding: var(--space-2xl) 0;
    }

    .section-container,
    .stats-container {
        padding: 0 var(--space-md);
    }

    /* Featured image size */
    .featured-image-wrapper {
        height: 180px;
    }

    /* Mobile Small: featured image adjustments */
    .card-image-wrapper {
        height: 170px;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    /* Tests section spacing */
    .card-content {
        padding: var(--space-sm);
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .card-subtitle {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .card-description {
        font-size: 0.65rem;
        margin-bottom: var(--space-xs);
        -webkit-line-clamp: 2;
    }

    .card-meta {
        font-size: 0.65rem;
    }

    /* Badge spacing */
    .card-badge,
    .featured-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
}

@media (max-width: 639px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: var(--space-lg);
    }
}



/* Scroll to top button */
.scroll-top-button {
    position: fixed;
    right: clamp(1rem, 3vw, 2.5rem);
    bottom: clamp(1rem, 3vw, 2.5rem);
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 32px rgba(102, 126, 234, 0.35);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.95);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
    z-index: 1000;
}

.scroll-top-button span {
    display: inline-block;
    transform: translateY(-2px);
}

.scroll-top-button.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-top-button:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 20px 36px rgba(102, 126, 234, 0.45);
}

.scroll-top-button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.35);
}

.scroll-top-button:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.4);
    outline-offset: 4px;
}

@media (max-width: 639px) {
    .scroll-top-button {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        box-shadow: 0 14px 24px rgba(102, 126, 234, 0.28);
    }
}

