/* Alphalabz - Global Styles with Dark/Light Mode */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Purple palette */
    --purple-900: #4C1D95;
    --purple-800: #5B21B6;
    --purple-700: #6D28D9;
    --purple-600: #7C3AED;
    --purple-500: #8B5CF6;
    --purple-400: #A78BFA;
    --purple-300: #C4B5FD;
    --purple-200: #DDD6FE;
    --purple-100: #EDE9FE;
    --purple-50: #F5F3FF;

    /* Dark mode (default) */
    --bg-primary: #0F0F0F;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #888888;
    --border-color: #2a2a2a;
    --card-bg: #1a1a1a;
    --card-border: #2a2a2a;
    --link-color: #A78BFA;
    --logo-filter: none;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #F5F3FF;
    --bg-tertiary: #EDE9FE;
    --text-primary: #1a1a1a;
    --text-secondary: #444444;
    --text-muted: #666666;
    --border-color: #DDD6FE;
    --card-bg: #ffffff;
    --card-border: #DDD6FE;
    --link-color: #6D28D9;
    --logo-filter: invert(0);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img { height: 48px; width: 48px; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.logo-text span { color: var(--purple-400); font-weight: 300; }

[data-theme="light"] .logo-text span { color: var(--purple-600); }

nav { display: flex; align-items: center; gap: 8px; }

nav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s;
}

nav a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    text-decoration: none;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: 8px;
}

.theme-toggle:hover { background: var(--purple-700); }
.theme-toggle svg { width: 20px; height: 20px; color: var(--text-primary); }
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }
[data-theme="light"] .theme-toggle { background: var(--purple-100); }
[data-theme="light"] .theme-toggle:hover { background: var(--purple-200); }

/* Hero */
.hero {
    text-align: center;
    padding: 80px 20px 100px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-logo { width: 140px; height: 140px; margin: 0 auto 40px; }

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--purple-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .hero h1 {
    background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--purple-700);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.hero-cta:hover {
    background: var(--purple-600);
    text-decoration: none;
}

/* Page Hero (for subpages) */
.page-hero {
    text-align: center;
    padding: 80px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--purple-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .page-hero h1 {
    background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.page-hero p { font-size: 1rem; color: var(--text-muted); }

/* Apps Section */
.apps-section {
    padding: 60px 20px 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header { text-align: center; margin-bottom: 60px; }
.section-title { font-size: 2.5rem; margin-bottom: 16px; color: var(--text-primary); }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; }

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

@media (max-width: 900px) {
    .apps-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 0 auto;
    }
}

.app-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid var(--card-border);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: var(--purple-600);
}

[data-theme="light"] .app-card:hover {
    box-shadow: 0 20px 40px rgba(76, 29, 149, 0.1);
}

.app-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--purple-900), var(--purple-800));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-card h3 { font-size: 1.5rem; margin-bottom: 12px; color: var(--text-primary); }
.app-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 28px; min-height: 60px; }

.app-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: background 0.2s;
}

.app-link:hover {
    background: var(--purple-700);
    color: white;
    text-decoration: none;
}

.app-link svg { width: 16px; height: 16px; }

/* Features Section */
.features-section {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

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

@media (max-width: 800px) {
    .features-grid { grid-template-columns: 1fr; gap: 30px; }
}

.feature { text-align: center; }

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: var(--purple-900);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .feature-icon { background: var(--purple-700); }

.feature h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-primary); }
.feature p { color: var(--text-muted); font-size: 0.95rem; }

/* Content (for pages like About, Privacy, Terms) */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.content h2 {
    font-size: 1.5rem;
    margin: 40px 0 16px;
    color: var(--purple-400);
}

[data-theme="light"] .content h2 { color: var(--purple-700); }

.content h2:first-of-type { margin-top: 0; }
.content p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }
.content ul, .content ol { color: var(--text-secondary); margin: 0 0 16px 24px; }
.content li { margin-bottom: 8px; }
.content strong { color: var(--text-primary); }

.highlight-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--purple-600);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 12px 12px 0;
}

.highlight-box p { margin: 0; }

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 32px 0;
}

@media (max-width: 600px) { .values-grid { grid-template-columns: 1fr; } }

.value-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--card-border);
}

.value-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-primary); }
.value-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

.cta-section {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    margin-top: 60px;
    border: 1px solid var(--card-border);
}

.cta-section h2 { font-size: 1.8rem; margin-bottom: 16px; color: var(--text-primary); }
.cta-section p { color: var(--text-muted); margin-bottom: 24px; }

.cta-btn {
    display: inline-block;
    padding: 14px 28px;
    background: var(--purple-700);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.cta-btn:hover {
    background: var(--purple-600);
    text-decoration: none;
}

/* Footer */
footer {
    padding: 60px 20px 40px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

@media (max-width: 800px) { .footer-content { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-content { grid-template-columns: 1fr; } }

.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { height: 36px; width: 36px; }
.footer-brand span { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); }
.footer-tagline { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.footer-column h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 10px; }
.footer-column a { color: var(--text-muted); font-size: 0.9rem; }
.footer-column a:hover { color: var(--text-primary); text-decoration: none; }

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }

/* Simple footer (for subpages) */
footer.simple {
    text-align: center;
    padding: 40px 20px;
}

footer.simple p { color: var(--text-muted); font-size: 0.9rem; }

footer.simple .footer-links {
    margin-top: 16px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 20px;
    }

    nav { flex-wrap: wrap; justify-content: center; }
    nav a { padding: 8px 12px; font-size: 0.9rem; }

    .hero { padding: 40px 20px 60px; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .hero-logo { width: 100px; height: 100px; }

    .page-hero { padding: 40px 20px 20px; }
    .page-hero h1 { font-size: 2rem; }

    .section-title { font-size: 1.8rem; }
    .app-card { padding: 30px 24px; }
    .cta-section { padding: 32px 24px; }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
