/**
 * Index/Homepage Styles
 * Mobile-First with Desktop Styles Preserved 100%
 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(45deg, #e74c3c, #c0392b);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --border-light: #e9ecef;
    --shadow-soft: 0 5px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
    --transition: all 0.3s ease;
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --navbar-height: 60px;
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--light-bg);
    margin: 0;
    padding: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Main content padding - dynamic based on navbar */
.main-content {
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px), radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.hero-feature i {
    color: #ffd700;
    font-size: 1.2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.6s both;
}

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

.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--text-dark);
}

/* Showcase Section */
.showcase-section {
    padding: 5rem 0;
    background: var(--light-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.showcase-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid var(--border-light);
    background: var(--white);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-muted);
}

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

.tab-content {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.showcase-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    text-align: center;
}

.showcase-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.showcase-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: var(--light-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    color: var(--white);
    background: var(--primary-gradient);
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-description {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    background: var(--white);
    text-align: center;
}

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

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.cta-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 2rem;
    text-align: center;
    color: #bdc3c7;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Section padding统一 */
    .hero-section,
    .showcase-section,
    .features-section,
    .cta-section {
        padding: 3rem 0;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .hero-features {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .hero-feature {
        justify-content: center;
        background: rgba(255, 255, 255, 0.15);
        padding: 0.75rem 1rem;
        border-radius: 30px;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Showcase Section */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .showcase-tabs {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .tab-btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
    }

    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .showcase-item {
        padding: 1rem;
    }

    .showcase-item h4 {
        font-size: 0.95rem;
        margin: 0.5rem 0 0.25rem;
    }

    .showcase-item p {
        font-size: 0.8rem;
    }

    .showcase-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    /* Features Section */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }

    .feature-card {
        text-align: left;
        padding: 1.5rem;
        margin: 0;
    }

    .feature-card:hover {
        transform: none;
    }

    .feature-card:active {
        transform: scale(0.99);
        background: #fafafa;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .feature-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .feature-description {
        font-size: 0.9rem;
    }

    /* CTA Section */
    .cta-title {
        font-size: 2rem;
        padding: 0 1rem;
    }

    .cta-description {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-section ul li a:active {
        color: var(--white);
        transform: translateX(5px);
    }

    /* Touch optimizations */
    button,
    .btn,
    .tab-btn,
    .feature-card,
    .showcase-item {
        cursor: pointer;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    a,
    button {
        touch-action: manipulation;
    }
}

/* Small phones */
@media (max-width: 374px) {
    .hero-title {
        font-size: 2rem;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .hero-feature {
        justify-content: flex-start;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-width: 768px) and (max-height: 600px) {
    .hero-section {
        min-height: auto;
        padding: 4rem 0 3rem;
    }

    .hero-features {
        flex-direction: row;
        flex-wrap: wrap;
    }

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

/* ===== HOMEPAGE NAVBAR OVERRIDES ===== */
body.homepage .global-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

body.homepage .global-navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

body.homepage .global-navbar-brand i {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 25%, #fff 50%, #e3f2fd 75%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    body.homepage .global-navbar-brand {
        font-size: 1.25rem;
    }
    
    body.homepage .global-navbar-brand i {
        font-size: 1.5rem;
    }
}

/* Navbar buttons (match reference) */
body.homepage .global-nav-link,
body:has(.hero-section) .global-nav-link {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.homepage .global-nav-link:hover,
body:has(.hero-section) .global-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

body.homepage .global-nav-link.active,
body:has(.hero-section) .global-nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

body.homepage .global-nav-link i,
body:has(.hero-section) .global-nav-link i {
    font-size: 1rem;
}

body.homepage .global-auth-buttons,
body:has(.hero-section) .global-auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center; justify-content: center; margin: 0 auto;
}

body.homepage .global-btn-outline,
body:has(.hero-section) .global-btn-outline {
    padding: 0.7rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

body.homepage .global-btn-outline:hover,
body:has(.hero-section) .global-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

body.homepage .global-btn-solid,
body:has(.hero-section) .global-btn-solid {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

body.homepage .global-btn-solid:hover,
body:has(.hero-section) .global-btn-solid:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

@media (min-width: 769px) {
    body.homepage .global-navbar-brand,
    body:has(.hero-section) .global-navbar-brand {
        margin-right: auto;
    }

    body.homepage .global-navbar-container,
    body:has(.hero-section) .global-navbar-container {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }

    body.homepage .global-navbar-nav,
    body:has(.hero-section) .global-navbar-nav {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 2.25rem;
    }

    body.homepage .global-auth-buttons,
    body:has(.hero-section) .global-auth-buttons,
    body.homepage .global-navbar-user,
    body:has(.hero-section) .global-navbar-user {
        display: flex;
        align-items: center;
        gap: 2rem;
        flex-shrink: 0;
    }

    body.homepage .global-nav-item,
    body:has(.hero-section) .global-nav-item {
        position: relative;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    body.homepage .global-nav-link,
    body:has(.hero-section) .global-nav-link,
    body.homepage .global-btn-outline,
    body:has(.hero-section) .global-btn-outline,
    body.homepage .global-btn-solid,
    body:has(.hero-section) .global-btn-solid {
        padding: 0.55rem 1rem;
    }

    body.homepage .global-auth-buttons,
    body:has(.hero-section) .global-auth-buttons {
        gap: 0.5rem;
    }
}