/* ========================================
   PCB Router - Custom Styles
   Based on Pico.css with customizations
   ======================================== */

/* CSS Variables */
:root {
    --primary: #0078d4;
    --primary-hover: #006cbd;
    --primary-light: #e6f2fc;
    --secondary: #6c757d;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 6px;
    --spacing: 1rem;
    
    --header-height: 72px;
    --hero-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Base Styles
   ======================================== */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-family);
    line-height: 1.6;
    padding-top: var(--header-height) !important;
    margin: 0 !important;
}

main {
    flex: 1;
    margin: 0;
    padding: 0;
    padding-bottom: 3rem;
}

/* Reset Pico.css default margins that cause white space */
body > header,
body > main,
body > footer,
.site-header,
.site-footer {
    margin: 0 !important;
}

/* Ensure no gap between main content and footer */
main + footer,
main + .site-footer {
    margin-top: 0 !important;
}

/* Remove bottom margin from last section in main */
main > section:last-child {
    margin-bottom: 0 !important;
}

/* Fix CTA section margin */
.cta {
    margin-bottom: 0 !important;
}

/* Ensure no gap between header and main content */
.site-header + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.site-header + .flash-messages {
    margin-top: 1.5rem !important;
    padding-top: 1rem;
}

/* Override Pico.css body padding/margin defaults */
body > * {
    margin-top: 0;
}

/* ========================================
   Header & Navigation
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e5e5;
    height: var(--header-height);
}

.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.brand:hover {
    text-decoration: none;
    color: var(--primary-hover);
}

.brand-icon {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: border-color 0.2s;
}

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

.lang-btn .chevron {
    transition: transform 0.2s;
}

.lang-btn .chevron.rotate {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow-hover);
    min-width: 120px;
    overflow: hidden;
    padding: 0.25rem 0;
}

.lang-option {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    line-height: 1.4;
    min-height: 36px;
}

.lang-option:hover {
    background-color: var(--primary-light);
    text-decoration: none;
}

.lang-option.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
}

.user-btn .chevron {
    transition: transform 0.2s;
}

.user-btn .chevron.rotate {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow-hover);
    min-width: 160px;
    overflow: hidden;
    padding: 0.25rem 0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    line-height: 1.4;
    min-height: 36px;
}

.user-dropdown a:hover {
    background-color: var(--primary-light);
    text-decoration: none;
}

/* Auth Buttons */
.btn-login {
    padding: 0.5rem 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: var(--primary-light);
    text-decoration: none;
}

.btn-primary {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    transition: transform 0.2s, opacity 0.2s;
}

/* ========================================
   Flash Messages
   ======================================== */

.flash-messages {
    margin-top: 1.5rem !important;
    padding-top: 1rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: flashSlideIn 0.3s ease forwards;
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.flash-messages.hiding {
    opacity: 0;
    transform: translateY(-20px);
    height: 0 !important;
    margin: 0 !important;
    padding: 0;
}

.flash {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
}

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    text-align: center;
    padding: 5rem 1.5rem;
    background: var(--hero-bg);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 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");
    opacity: 0.5;
}

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

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

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

.hero-buttons a {
    min-width: 140px;
    padding: 0.625rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.hero-buttons .primary {
    background: white;
    color: var(--primary);
    border: 2px solid white;
}

.hero-buttons .primary:hover {
    background: #f0f0f0;
}

.hero-buttons .outline {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    background: transparent;
}

.hero-buttons .outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

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

.hero-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* PCB Demo Animation */
.hero-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.pcb-demo {
    width: 400px;
    height: 250px;
    position: relative;
}

.pcb-board {
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid #1a1a3a;
}

.trace {
    position: absolute;
    background: linear-gradient(90deg, #cc3333, #992222);
    border-radius: 2px;
    opacity: 0;
    animation: drawTrace 2s ease-out forwards;
    box-shadow: 0 0 10px rgba(204, 51, 51, 0.5);
}

.trace-1 {
    width: 200px;
    height: 3px;
    top: 50px;
    left: 30px;
    animation-delay: 0.5s;
}

.trace-2 {
    width: 3px;
    height: 120px;
    top: 50px;
    left: 230px;
    animation-delay: 1s;
}

.trace-3 {
    width: 100px;
    height: 3px;
    top: 170px;
    left: 230px;
    animation-delay: 1.5s;
}

.component {
    position: absolute;
    background: #004080;
    border-radius: 4px;
    border: 2px solid #0060c0;
}

.comp-1 {
    width: 40px;
    height: 40px;
    top: 30px;
    left: 10px;
}

.comp-2 {
    width: 30px;
    height: 30px;
    top: 155px;
    left: 330px;
}

.comp-3 {
    width: 50px;
    height: 25px;
    top: 100px;
    left: 100px;
}

@keyframes drawTrace {
    from {
        opacity: 0;
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* ========================================
   Pricing Page
   ======================================== */

.pricing-header {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.pricing-header h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.pricing-header p {
    color: #666;
    font-size: 1.1rem;
}

.pricing-plans {
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-plans .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
}

.pricing-card {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: var(--card-shadow);
    border: 2px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.pricing-card.popular {
    border-color: var(--primary);
    transform: scale(1.02);
}

.pricing-card.popular:hover {
    transform: scale(1.02) translateY(-4px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card h3 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    text-align: center;
}

.plan-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.price {
    text-align: center;
    margin-bottom: 2rem;
}

.price .amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.price .period {
    color: #666;
    font-size: 1rem;
}

.price .period-alt {
    color: #888;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.price-option {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

.price-option.yearly {
    margin-top: 0.5rem;
}

.price-divider {
    color: #888;
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex: 1;
}

.pricing-card .features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 0.95rem;
}

.pricing-card .features li:last-child {
    border-bottom: none;
}

.pricing-card .features li::before {
    font-weight: bold;
    margin-right: 0.5rem;
}

.pricing-card .features li.feature-yes::before {
    content: '✓';
    color: var(--success);
}

.pricing-card .features li.feature-no::before {
    content: '✗';
    color: #dc3545;
}

.pricing-card .features li.feature-no {
    color: #888;
}

.pricing-card a[role="button"] {
    width: 100%;
    text-align: center;
    padding: 0.875rem;
    font-weight: 600;
}

.pricing-card a[role="button"].outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.pricing-card a[role="button"].outline:hover {
    background: var(--primary-light);
}

/* Pricing FAQ */
.pricing-faq {
    padding: 4rem 1.5rem;
    background: #f8f9fa;
}

.pricing-faq h2 {
    text-align: center;
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 2rem;
}

.pricing-faq details {
    max-width: 800px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.pricing-faq summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: #1a1a2e;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pricing-faq summary::-webkit-details-marker {
    display: none;
}

.pricing-faq summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
}

.pricing-faq details[open] summary::after {
    content: '−';
}

.pricing-faq details p {
    padding: 0 1.25rem 1.25rem;
    margin: 0;
    color: #666;
}

/* Pricing Contact */
.pricing-contact {
    text-align: center;
    padding: 4rem 1.5rem;
}

.pricing-contact h2 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.pricing-contact p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* ========================================
   Download Section
   ======================================== */

.download-section {
    padding: 5rem 1.5rem;
    background: #f8f9fa;
    text-align: center;
}

.download-section h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.download-subtitle {
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto 3rem;
}

.download-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

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

.download-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.download-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.download-version,
.download-date {
    color: #666;
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.download-btn {
    display: inline-block;
    margin: 1.5rem 0 1rem;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.download-btn:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

.download-requirements {
    display: block;
    color: #888;
    font-size: 0.8rem;
}

.download-notes {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.download-notes p {
    margin: 0.5rem 0;
}

.download-notes a {
    color: var(--primary);
    text-decoration: none;
}

.download-notes a:hover {
    text-decoration: underline;
}

/* ========================================
   Features Section
   ======================================== */

.features {
    padding: 5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1a1a2e;
}

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

.features article {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.features h3 {
    margin: 1rem 0;
    font-size: 1.25rem;
    color: #1a1a2e;
}

.features p {
    color: #666;
    margin: 0;
}

/* ========================================
   How It Works
   ======================================== */

.how-it-works {
    padding: 5rem 1.5rem;
    background: #f8f9fa;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1a1a2e;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    padding: 2rem;
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #1a1a2e;
}

.step p {
    color: #666;
    margin: 0;
}

/* ========================================
   CTA Section
   ======================================== */

.cta {
    text-align: center;
    padding: 5rem 1.5rem;
    background: var(--hero-bg);
    color: white;
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 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");
}

.cta > * {
    position: relative;
    z-index: 1;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.cta p {
    margin-bottom: 2rem;
    opacity: 1;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cta a {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: white;
    color: var(--primary);
    border: none;
}

.cta a:hover {
    background: #f0f0f0;
}

/* Add proper spacing between CTA and footer */
.cta {
    margin-bottom: 0 !important;
}

main {
    padding-bottom: 4rem !important;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 1.5rem 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand strong {
    font-size: 1.25rem;
    color: white;
}

.footer-brand p {
    color: #888;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom small {
    color: #666;
}

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

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: var(--card-shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-link,
    .btn-login,
    .btn-primary {
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .lang-switcher,
    .user-menu {
        width: 100%;
    }
    
    .lang-btn,
    .user-btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons a {
        width: 100%;
        max-width: 280px;
    }
    
    .features h2,
    .how-it-works h2,
    .download-section h2,
    .cta h2 {
        font-size: 1.75rem;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
   Docs Page Layout
   ======================================== */

.docs-page {
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

.docs-sidebar {
    width: 260px;
    padding: 2rem 0;
    position: absolute;
    top: 0;
    left: max(2rem, calc((100% - 1200px) / 2));
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.docs-nav {
    padding: 0 1rem;
}

.docs-nav details {
    margin-bottom: 0.5rem;
}

.docs-nav summary {
    font-weight: 600;
    cursor: pointer;
    padding: 0.75rem 0;
    color: #1a1a2e;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.docs-nav summary::-webkit-details-marker {
    display: none;
}

.docs-nav summary::after {
    content: '›';
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.docs-nav details[open] summary::after {
    transform: rotate(90deg);
}

.docs-nav ul {
    list-style: none;
    padding-left: 1rem;
    margin: 0.5rem 0;
}

.docs-nav li {
    margin: 0.25rem 0;
}

.docs-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

.docs-nav a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.docs-main {
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
}

.docs-content {
    max-width: 800px;
    width: 100%;
    margin-left: 280px;
}

.docs-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.docs-content section {
    margin-bottom: 3rem;
}

.docs-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.docs-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.docs-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #444;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.docs-content li > p {
    margin: 0.5rem 0;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.docs-content th,
.docs-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.docs-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a1a2e;
}

.docs-content tr:last-child td {
    border-bottom: none;
}

.docs-content pre {
    background: #1a1a2e;
    color: #e4e4e4;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.docs-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.docs-content pre code {
    color: #e4e4e4;
}

.docs-content details {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.docs-content details summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: #1a1a2e;
    background: #f8f9fa;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.docs-content details summary::-webkit-details-marker {
    display: none;
}

.docs-content details summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
}

.docs-content details[open] summary::after {
    content: '−';
}

.docs-content details > *:not(summary) {
    padding: 1rem 1.25rem;
}

/* Mobile Docs */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 100%;
        position: static;
        border-bottom: 1px solid #e5e5e5;
        padding: 1rem 0;
        left: 0;
    }
    
    .docs-main {
        padding: 2rem 1rem;
    }
    
    .docs-content {
        margin-left: 0;
    }
    
    .docs-page {
        display: flex;
        flex-direction: column;
    }
}

/* ========================================
   Auth Pages
   ======================================== */

.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.auth-container {
    width: 100%;
    max-width: 560px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #666;
    margin: 0;
}

/* OAuth Section */
.oauth-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-section .oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    background: white;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s, border-color 0.2s;
    min-height: 2.25rem !important;
    height: auto !important;
    line-height: 1.4;
}

.oauth-btn:hover {
    background-color: #f8f9fa;
    border-color: #d0d0d0;
    text-decoration: none;
}

.oauth-btn.google:hover {
    border-color: #4285F4;
}

.oauth-section .oauth-btn.wechat {
    background: #07C160;
    border-color: #07C160;
    color: white;
}

.oauth-section .oauth-btn.wechat:hover {
    background: #06ad56;
    border-color: #06ad56;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #888;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.divider span {
    padding: 0 1rem;
}

/* Auth Form */
.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 0.75rem;
    align-items: center;
}

.form-group {
    display: contents;
}

.form-group label {
    grid-column: 1;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    text-align: right;
    line-height: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.auth-form .form-group input[type="email"],
.auth-form .form-group input[type="password"],
.auth-form .form-group input[type="tel"],
.auth-form .form-group input[type="text"] {
    grid-column: 2;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 2.25rem !important;
    line-height: 1.4;
    margin: 0;
    min-width: 0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-group .form-hint {
    grid-column: 2;
    margin-top: calc(-0.75rem + 2px);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: #888;
}

.form-options {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.form-group:has(.checkbox-label) label {
    grid-column: 1 / -1;
    justify-content: flex-start;
    height: auto;
    line-height: 1.5;
}

/* Form group with hint - allow wrapping */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label.terms {
    font-size: 0.875rem;
    line-height: 1.5;
}

.checkbox-label.terms a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-label.terms a:hover {
    text-decoration: underline;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.auth-form .btn-submit,
button[type="submit"].btn-submit {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0.5rem 0.75rem !important;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 2.25rem !important;
    height: auto !important;
    line-height: 1.4;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.auth-footer p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer .alt-login {
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Phone Login Specific */
.phone-code-group {
    display: flex;
    flex: 1;
    gap: 0.75rem;
}

.phone-code-group input {
    flex: 1;
}

.phone-code-group button {
    white-space: nowrap;
    padding: 0.5rem 0.75rem !important;
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 2.25rem !important;
    height: auto !important;
    line-height: 1.4;
}

.phone-code-group button:hover:not(:disabled) {
    background: var(--primary-light);
}

.phone-code-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Captcha
   ======================================== */

.captcha-group {
    grid-column: 2;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.captcha-group input[type="text"] {
    flex: 1;
    min-width: 80px;
}

.captcha-image {
    height: 2.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid #e5e5e5;
}

.captcha-image:hover {
    opacity: 0.9;
}

/* ========================================
   Utility Classes
   ======================================== */

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

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.full-width {
    width: 100%;
}

/* ========================================
   Profile Page
   ======================================== */

.profile-section {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.profile-section h1 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 2rem;
    text-align: center;
}

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

.profile-section article {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.profile-section article h2 {
    font-size: 1.25rem;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}

/* Profile Form */
.profile-section form .form-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.profile-section form label {
    flex-shrink: 0;
    width: 100px;
    text-align: right;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.profile-section form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    min-width: 0;
}

.profile-section form input:disabled {
    background: #f8f9fa;
    color: #666;
}

.profile-section form .form-hint {
    margin-left: calc(100px + 0.75rem);
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.profile-section form .form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* Account Info */
.account-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #666;
    font-size: 0.9rem;
}

.info-row .value {
    font-weight: 500;
    color: #1a1a2e;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

/* Connected Accounts */
.connected-accounts {
    margin-top: 2rem;
}

.oauth-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oauth-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e5e5e5;
}

.oauth-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333;
    font-weight: 500;
}

.oauth-info svg {
    color: var(--primary);
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-section .grid {
        grid-template-columns: 1fr;
    }
    
    .profile-section form .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .profile-section form label {
        width: auto;
        text-align: left;
    }
    
    .profile-section form input {
        width: 100%;
    }
    
    .profile-section form .form-hint {
        margin-left: 0;
    }
    
    .profile-section form .form-actions {
        text-align: center;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a1a2e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f0f0f0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* ========================================
   About Page
   ======================================== */

.about-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

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

.about-header h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.about-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin: 0;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.about-card h2 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}

.about-card p {
    color: #444;
    line-height: 1.8;
    margin: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-item h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
}

.feature-item p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.vision-text {
    font-size: 1.1rem;
    font-style: italic;
    color: #555;
    text-align: center;
    padding: 1rem 0;
}

.contact-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, #f8f9fa 100%);
}

.contact-info {
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.contact-label {
    font-weight: 500;
    color: #333;
}

.contact-item a {
    color: var(--primary);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .about-header h1 {
        font-size: 1.75rem;
    }
    
    .about-subtitle {
        font-size: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .about-card {
        padding: 1.5rem;
    }
}
