/* ========================================
   QuizMaster - Homepage Styles
   ======================================== */

/* Main Content Area */
.page {
    padding-top: 80px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    position: relative;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem var(--container-padding) 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    overflow: hidden;
}

/* 移动端优化 - 增加顶部间距避免被导航栏遮挡 */
@media (max-width: 767px) {
    .hero-section {
        padding-top: 8rem;
        min-height: auto;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin-bottom: 3rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-badge svg {
    width: 16px;
    height: 16px;
    fill: #FBBF24;
    stroke: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.hero-actions .btn-primary {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.15);
}

.hero-actions .btn-primary:hover {
    background: var(--gray-50);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hero-actions .btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
    color: var(--white);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats .stat-item {
    text-align: center;
}

.hero-stats .stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
}

.hero-stats .stat-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    z-index: 1;
    display: none;
}

.floating-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--white);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--white);
    bottom: -50px;
    left: -50px;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--white);
    top: 50%;
    left: 30%;
}

.quiz-card-preview {
    display: none;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 300px;
}

.quiz-card-preview .card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.quiz-card-preview .card-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
}

.quiz-card-preview .card-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* ========================================
   Quizzes Section
   ======================================== */
.quizzes-section {
    padding: 4rem 0;
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--gray-700);
    transition: all var(--transition);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: all var(--transition);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
}

.filter-btn.active svg {
    color: var(--white);
}

/* Quiz Groups */
.quiz-group {
    margin-bottom: 4rem;
}

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

/* ========================================
   About Section
   ======================================== */
.about-section {
    padding: 5rem 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

.about-text .section-title {
    margin-bottom: 1.5rem;
}

.about-description {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-item {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.feature-item:hover {
    background: var(--gray-100);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.feature-item h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* CTA Card */
.about-cta {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-card {
    background: var(--gradient-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    color: var(--white);
    max-width: 400px;
    width: 100%;
}

.cta-icon {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.cta-icon svg {
    width: 36px;
    height: 36px;
}

.cta-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cta-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cta-card .btn {
    background: var(--white);
    color: var(--primary);
    width: 100%;
    justify-content: center;
}

.cta-card .btn:hover {
    background: var(--gray-50);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (min-width: 640px) {
    .hero-section {
        padding: 5rem var(--container-padding);
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-actions {
        flex-direction: row;
    }

    .hero-stats {
        gap: 3rem;
    }

    .hero-stats .stat-number {
        font-size: 2rem;
    }

    .about-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .hero-section {
        min-height: 600px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-visual {
        display: block;
    }

    .quiz-card-preview {
        display: block;
        animation: float 6s ease-in-out infinite;
    }

    .about-content {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .cta-card {
        padding: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .page {
        padding-top: 100px;
    }

    .hero-section {
        min-height: 650px;
        padding: 6rem var(--container-padding);
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.375rem;
    }

    .quizzes-section {
        padding: 5rem 0;
    }

    .about-section {
        padding: 6rem 0;
    }

    .filter-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }

    .search-box {
        flex: 1;
        max-width: 400px;
        margin-bottom: 0;
    }

    .category-filters {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1280px) {
    .hero-section {
        padding: 8rem var(--container-padding);
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .about-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Page Load Animation */
.hero-content > * {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }
.hero-content > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animation */
.quiz-group {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.quiz-group:nth-child(1) { animation-delay: 0.2s; }
.quiz-group:nth-child(2) { animation-delay: 0.3s; }
.quiz-group:nth-child(3) { animation-delay: 0.4s; }
.quiz-group:nth-child(4) { animation-delay: 0.5s; }
