/* ===================================
   kapagame - Home Page Styles
   Modern, stylish, mobile-first design
   =================================== */

/* ===================================
   Hero Section - Full-screen Banner
   =================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    overflow: hidden;
    padding: 120px 0 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50px;
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.hero-badge svg {
    width: 18px;
    height: 18px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Feature Pills */
.hero-pills {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    font-size: 0.875rem;
    color: #cbd5e1;
    backdrop-filter: blur(10px);
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pill-dot.math { background: #3b82f6; }
.pill-dot.physics { background: #8b5cf6; }
.pill-dot.units { background: #10b981; }
.pill-dot.time { background: #f59e0b; }

/* Hero Math Symbols */
.hero-symbols {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.symbol {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.06);
    font-weight: 700;
    animation: symbolFloat 20s ease-in-out infinite;
}

.symbol-1 { top: 15%; left: 8%; font-size: 3rem; animation-delay: 0s; }
.symbol-2 { top: 25%; right: 12%; font-size: 2.5rem; animation-delay: -3s; }
.symbol-3 { top: 60%; left: 5%; font-size: 2rem; animation-delay: -6s; }
.symbol-4 { top: 70%; right: 8%; font-size: 2.8rem; animation-delay: -9s; }
.symbol-5 { top: 40%; left: 15%; font-size: 2.2rem; animation-delay: -12s; }
.symbol-6 { top: 80%; left: 20%; font-size: 1.8rem; animation-delay: -15s; }
.symbol-7 { top: 20%; right: 20%; font-size: 2.4rem; animation-delay: -18s; }
.symbol-8 { top: 50%; right: 15%; font-size: 2rem; animation-delay: -2s; }

@keyframes symbolFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.06; }
    25% { transform: translateY(-20px) rotate(5deg); opacity: 0.1; }
    50% { transform: translateY(0) rotate(0deg); opacity: 0.06; }
    75% { transform: translateY(20px) rotate(-5deg); opacity: 0.1; }
}

/* Hero Scroll Indicator */
.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-arrow svg {
    width: 20px;
    height: 20px;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Additional Floating Elements */
.hero-floating-4 {
    top: 30%;
    left: 25%;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border-radius: 8px;
    transform: rotate(45deg);
    animation: float2 10s ease-in-out infinite;
}

.hero-floating-5 {
    bottom: 30%;
    right: 25%;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
    border-radius: 50%;
    animation: float3 9s ease-in-out infinite;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-actions .btn svg {
    width: 20px;
    height: 20px;
}

.hero-actions .btn-white {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.hero-actions .btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Floating Elements Animation */
.hero-floating {
    position: absolute;
    pointer-events: none;
}

.hero-floating-1 {
    top: 20%;
    left: 10%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    border-radius: 24px;
    transform: rotate(15deg);
    animation: float1 6s ease-in-out infinite;
}

.hero-floating-2 {
    top: 60%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(59, 130, 246, 0.3));
    border-radius: 50%;
    animation: float2 8s ease-in-out infinite;
}

.hero-floating-3 {
    bottom: 20%;
    left: 20%;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.3));
    border-radius: 12px;
    transform: rotate(-10deg);
    animation: float3 7s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: rotate(15deg) translateY(0); }
    50% { transform: rotate(15deg) translateY(-20px); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

@keyframes float3 {
    0%, 100% { transform: rotate(-10deg) translateY(0); }
    50% { transform: rotate(-10deg) translateY(-25px); }
}

/* ===================================
   Tools Section
   =================================== */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Category Grid - Optimized Layout */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Category Cards - Enhanced Design */
.category-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-accent, var(--primary-color)), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.category-card:hover::before {
    opacity: 1;
}

/* Card Color Accents */
.category-card:nth-child(1) { --card-accent: #3b82f6; }
.category-card:nth-child(2) { --card-accent: #8b5cf6; }
.category-card:nth-child(3) { --card-accent: #10b981; }
.category-card:nth-child(4) { --card-accent: #f59e0b; }
.category-card:nth-child(5) { --card-accent: #ec4899; }
.category-card:nth-child(6) { --card-accent: #06b6d4; }

.category-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon.math {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
}

.category-icon.physics {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: #8b5cf6;
}

.category-icon.units {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
}

.category-icon.time {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #f59e0b;
}

.category-icon.guides {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05));
    color: #ec4899;
}

.category-icon.glossary {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    color: #06b6d4;
}

.category-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.category-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Category Links */
.category-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-link svg {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.category-link:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateX(6px);
    border-color: var(--primary-color);
}

.category-link:hover svg {
    color: #ffffff;
}

/* ===================================
   Features Section
   =================================== */
.features-section {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon.free {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
}

.feature-icon.privacy {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.05));
    color: #7c3aed;
}

.feature-icon.education {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #f59e0b;
}

.feature-icon.mobile {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    color: #06b6d4;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   Stats Section
   =================================== */
.stats-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    position: relative;
    z-index: 1;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ===================================
   CTA Section
   =================================== */
.cta-section {
    padding: 100px 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.cta-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ===================================
   Responsive Design - Tablet
   =================================== */
@media (max-width: 1024px) {
    .hero {
        min-height: auto;
        padding: 140px 0 80px;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    /* Popular Tools - 平板2列布局 */
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ===================================
   Responsive Design - Mobile
   =================================== */
@media (max-width: 768px) {
    .hero {
        padding: 120px 0 60px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hero-floating {
        display: none;
    }
    
    .hero-symbols {
        display: none;
    }
    
    .hero-scroll {
        display: none;
    }
    
    .hero-pills {
        gap: 8px;
    }
    
    .hero-pill {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-card {
        padding: 24px;
    }
    
    .category-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .category-link {
        padding: 12px 14px;
        font-size: 0.875rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 28px 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .stat-number {
        font-size: 2.25rem;
    }
    
    .cta-section {
        padding: 60px 0;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-outline {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ===================================
   Responsive Design - Small Mobile
   =================================== */
@media (max-width: 480px) {
    .hero {
        padding: 100px 0 50px;
    }
    
    .hero-badge {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section {
        padding: 48px 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .category-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .category-link {
        padding: 10px 12px;
    }
    
    .stats-section {
        padding: 60px 0;
    }
    
    .stat-number {
        font-size: 1.875rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
}

/* ===================================
   Scroll Animations (optional)
   =================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Dark Mode Enhancements
   =================================== */
@media (prefers-color-scheme: dark) {
    .category-card {
        background: rgba(30, 41, 59, 0.5);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .category-card:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    
    .category-link {
        background: rgba(15, 23, 42, 0.5);
    }
    
    .feature-card {
        background: rgba(30, 41, 59, 0.5);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* ===================================
   Quick Search Section
   =================================== */
.search-section {
    padding: 60px 0 40px;
    /* background: linear-gradient(180deg, #0f172a 0%, var(--bg-primary) 100%); */
    margin-top: -1px;
}

.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 30px rgba(37, 99, 235, 0.2);
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    margin-left: 16px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 12px;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 10px;
    color: var(--text-tertiary);
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: var(--primary-color);
    color: white;
}

.search-clear svg {
    width: 18px;
    height: 18px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 22px;
    height: 22px;
}

.search-result-icon.math { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.search-result-icon.physics { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.search-result-icon.units { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.search-result-icon.time { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.search-result-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.search-result-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.search-no-results {
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
}

/* ===================================
   Popular Tools Section
   =================================== */
.popular-section {
    padding: 40px 0 80px;
}

.popular-header {
    text-align: center;
    margin-bottom: 40px;
}

.popular-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.popular-title svg {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

.popular-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 100%;
    overflow: hidden;
}

.popular-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
}

.popular-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.popular-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.popular-card:hover .popular-icon {
    transform: scale(1.1);
}

.popular-icon svg {
    width: 26px;
    height: 26px;
}

.popular-icon.math {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
}

.popular-icon.physics {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: #8b5cf6;
}

.popular-icon.units {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
}

.popular-icon.time {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #f59e0b;
}

.popular-content {
    flex: 1;
    min-width: 0;
}

.popular-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.popular-arrow svg {
    width: 20px;
    height: 20px;
}

.popular-card:hover .popular-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ===================================
   Tool Guides Section
   =================================== */
.guides-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.guide-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.guide-number {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 4rem;
    font-weight: 800;
    color: var(--bg-secondary);
    line-height: 1;
    pointer-events: none;
    transition: color 0.3s ease;
}

.guide-card:hover .guide-number {
    color: rgba(37, 99, 235, 0.1);
}

.guide-content {
    position: relative;
    z-index: 1;
    flex: 1;
}

.guide-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.guide-card:hover .guide-icon {
    transform: scale(1.1);
}

.guide-icon svg {
    width: 28px;
    height: 28px;
}

.guide-icon.math {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
}

.guide-icon.physics {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: #8b5cf6;
}

.guide-icon.units {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
}

.guide-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.guide-content > p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.guide-topics {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-topics li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.guide-topics li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-arrow {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 24px;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.guide-arrow svg {
    width: 24px;
    height: 24px;
}

.guide-card:hover .guide-arrow {
    color: var(--primary-color);
    transform: translateX(6px);
}

/* ===================================
   Responsive - Search Section
   =================================== */
@media (max-width: 768px) {
    .search-section {
        padding: 40px 0 30px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 14px 10px;
    }
    
    .popular-section {
        padding: 30px 0 60px;
    }
    
    .popular-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .popular-card {
        padding: 16px;
    }
    
    .popular-icon {
        width: 48px;
        height: 48px;
    }
    
    .guides-section {
        padding: 60px 0;
    }
    
    .guides-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .guide-card {
        padding: 24px;
    }
    
    .guide-number {
        font-size: 3rem;
        top: 16px;
        right: 20px;
    }
}

/* @media (max-width: 1024px) {
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guides-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guides-grid .guide-card:last-child {
        grid-column: span 2;
    }
} */

@media (max-width: 480px) {
    .search-section {
        padding: 30px 0 20px;
    }
    
    .search-box {
        border-radius: 12px;
    }
    
    .search-icon {
        margin-left: 12px;
        width: 20px;
        height: 20px;
    }
    
    .search-input {
        font-size: 0.95rem;
        padding: 12px 8px;
    }
    
    .popular-header {
        margin-bottom: 24px;
    }
    
    .popular-title {
        font-size: 1.25rem;
    }
    
    .guide-content h3 {
        font-size: 1.1rem;
    }
}

/* ===================================
   Glossary Section
   =================================== */
.glossary-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.glossary-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.glossary-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.glossary-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    flex-shrink: 0;
}

.glossary-icon svg {
    width: 32px;
    height: 32px;
    color: #60a5fa;
}

.glossary-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.glossary-text p {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.7;
    margin: 0;
}

.glossary-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.glossary-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.glossary-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
}

.glossary-link-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.glossary-link-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.glossary-link-text strong {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.glossary-link-text small {
    font-size: 0.8rem;
    color: #94a3b8;
}

.glossary-link-all {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.glossary-link-all:hover {
    background: rgba(59, 130, 246, 0.3);
}

.glossary-link-all .glossary-link-icon {
    background: var(--primary-color);
    color: #ffffff;
}

/* Glossary Responsive */
@media (max-width: 1024px) {
    .glossary-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .glossary-section {
        padding: 60px 0;
    }
    
    .glossary-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .glossary-text h2 {
        font-size: 1.5rem;
    }
    
    .glossary-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .glossary-section {
        padding: 48px 0;
    }
    
    .glossary-icon {
        width: 56px;
        height: 56px;
    }
    
    .glossary-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .glossary-text h2 {
        font-size: 1.25rem;
    }
    
    .glossary-link {
        padding: 14px 16px;
    }
}

/* ===================================
   FAQ Section
   =================================== */
.faq-section {
    padding: 100px 0;
    background: var(--bg-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question span {
    flex: 1;
}

.faq-question svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 24px 20px;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-answer a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* FAQ Responsive */
@media (max-width: 768px) {
    .faq-section {
        padding: 60px 0;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .faq-question {
        padding: 16px 20px;
        font-size: 0.95rem;
    }
    
    .faq-answer p {
        padding: 0 20px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 16px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .hero-pills {
        gap: 6px;
    }
    
    .hero-pill {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Search Section */
    .search-section {
        padding: 40px 0 24px;
    }
    
    .search-box {
        padding: 12px;
    }
    
    /* Popular Tools */
    .popular-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-description {
        font-size: 0.95rem;
    }
    
    .popular-grid {
        gap: 12px;
    }
    
    .popular-card {
        padding: 16px;
        gap: 12px;
    }
    
    .popular-icon {
        width: 44px;
        height: 44px;
    }
    
    .popular-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .popular-content h3 {
        font-size: 0.95rem;
    }
    
    .popular-content p {
        font-size: 0.8rem;
    }
    
    .popular-arrow {
        width: 28px;
        height: 28px;
    }
    
    .popular-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    /* Category Cards */
    .category-card {
        padding: 20px;
    }
    
    .category-card-header {
        gap: 12px;
    }
    
    .category-icon {
        width: 44px;
        height: 44px;
    }
    
    .category-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .category-card h3 {
        font-size: 1.125rem;
    }
    
    .category-card p {
        font-size: 0.875rem;
    }
    
    .tool-list li {
        padding: 10px 0;
        font-size: 0.875rem;
    }
    
    /* Tool Guides */
    .guide-card {
        padding: 20px;
    }
    
    .guide-icon {
        font-size: 2rem;
    }
    
    .guide-card h3 {
        font-size: 1.125rem;
    }
    
    .guide-card p {
        font-size: 0.875rem;
    }
    
    /* Glossary Section */
    .glossary-section {
        padding: 60px 0;
    }
    
    .glossary-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .glossary-icon {
        font-size: 3rem;
    }
    
    .glossary-text h2 {
        font-size: 1.75rem;
    }
    
    .glossary-text p {
        font-size: 0.9rem;
    }
    
    .glossary-links {
        grid-template-columns: 1fr;
    }
    
    /* Features */
    .features-section {
        padding: 60px 0;
    }
    
    .features-grid {
        gap: 24px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
    }
    
    .feature-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .feature-title {
        font-size: 1.125rem;
    }
    
    /* Stats */
    .stats-section {
        padding: 60px 0;
    }
    
    .stats-grid {
        gap: 32px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    /* CTA */
    .cta-section {
        padding: 60px 0;
    }
    
    .cta-content {
        padding: 32px 20px;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    /* FAQ */
    .faq-section {
        padding: 48px 0;
    }
    
    .faq-item {
        border-radius: 12px;
    }
    
    .faq-question {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .faq-answer p {
        padding: 0 16px 14px;
        font-size: 0.85rem;
    }
}
