/* === FONT & THEME VARIABLES === */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hue-primary: 240; /* Indigo */
    --hue-secondary: 280; /* Magenta/Purple */
    --transition: 0.3s ease;

    /* Light Mode */
    --bg-main: #f8f9fc;
    --bg-glass: rgba(255, 255, 255, 0.5);
    --bg-card: #ffffff;
    --bg-subtle: #f1f3f8;
    --border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a202c;
    --text-secondary: #5a677d;
    --shadow-color: 220, 40%, 50%;
    --primary: hsl(var(--hue-primary), 90%, 65%);
    --primary-dark: hsl(var(--hue-primary), 90%, 55%);
    --grad-1: hsl(var(--hue-primary), 100%, 85%);
    --grad-2: hsl(var(--hue-secondary), 100%, 90%);
}

.dark-mode {
    /* Dark Mode */
    --bg-main: #131824;
    --bg-glass: rgba(28, 35, 51, 0.5);
    --bg-card: #1c2333;
    --bg-subtle: #2a3346;
    --border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f4f9;
    --text-secondary: #a0aec0;
    --shadow-color: 220, 40%, 0%;
    --primary: hsl(var(--hue-primary), 80%, 70%);
    --primary-dark: hsl(var(--hue-primary), 80%, 80%);
    --grad-1: hsl(var(--hue-primary), 80%, 20%);
    --grad-2: hsl(var(--hue-secondary), 80%, 25%);
}

/* === BASE & LAYOUT === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color var(--transition), color var(--transition);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Aurora Gradient Background */
body::before, body::after {
    content: ''; position: fixed; z-index: -1;
    border-radius: 50%; filter: blur(150px);
    transition: background-color 0.5s;
}
body::before {
    width: 500px; height: 500px; background: var(--grad-1);
    top: -20%; left: -10%; animation: pulse 15s infinite alternate;
}
body::after {
    width: 600px; height: 600px; background: var(--grad-2);
    bottom: -25%; right: -15%; animation: pulse 20s infinite alternate-reverse;
}
@keyframes pulse { from { transform: scale(0.8); } to { transform: scale(1.2); } }

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}
main { padding-top: 75px; } /* Offset for fixed header */

/* === TYPOGRAPHY & BUTTONS === */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
}
p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

.btn-primary {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    background-color: var(--primary);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(var(--shadow-color), 0.2);
    transition: all var(--transition);
    text-align: center;
}
.btn-primary:hover {
    transform: translateY(-3px);
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(var(--shadow-color), 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    transition: all var(--transition);
}
.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* === HEADER === */
.header {
    background-color: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    transition: padding var(--transition), background-color var(--transition);
}
.header.scrolled {
    box-shadow: 0 2px 10px rgba(var(--shadow-color), 0.05);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.logo-img { height: 40px; }
.logo-text h1 {
    font-size: 1.3rem;
    margin-bottom: 0;
    color: var(--text-primary);
}
.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1;
}
.navbar ul {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}
.navbar ul li a {
    color: var(--text-primary);
    font-weight: 500;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-subtle);
    transition: var(--transition);
    border-radius: 24px;
    border: 1px solid var(--border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.dark-mode .slider:before { background-color: var(--bg-main); }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* === GENERIC PAGE STYLES === */
.page-hero {
    padding: 60px 0;
    text-align: center;
    background-color: var(--bg-subtle);
}
.page-hero h1 { font-size: 2.8rem; }
.page-hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}
.blog-page-section,
.contact-section,
.blog-post-section {
    padding: 80px 0;
}

/* === HERO SECTION (Homepage) === */
.hero {
    padding: 80px 0;
    text-align: center;
}
.hero-content h2 {
    font-size: 3.5rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}
.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}
.hero-image {
    margin-top: 3rem;
    position: relative;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.1);
    overflow: hidden;
    background-color: var(--bg-subtle);
}
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === TOOLS & BLOG SECTION === */
.tools-section,
.blog-section {
    padding: 80px 0;
}
.tools-grid,
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.tool-card,
.blog-card {
    display: block;
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.05);
    transition: all var(--transition);
}
.tool-card:hover,
.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(var(--shadow-color), 0.1);
    border-color: var(--primary);
}
.tool-image,
.blog-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--bg-subtle);
}
.tool-image img,
.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tool-info,
.blog-content {
    padding: 25px;
}
.tool-info h3,
.blog-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.tool-info p,
.blog-content p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.tool-link {
    font-weight: 600;
    color: var(--primary);
}
.blog-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}
.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* === VIDEO SECTION === */
.video-section {
    padding: 80px 0;
    background-color: var(--bg-subtle);
}
.video-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.1);
    aspect-ratio: 16 / 9;
}
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    transition: transform var(--transition);
}
.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
}
.video-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.video-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.video-fallback {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.video-fallback a { font-weight: 600; }

/* === FEATURES SECTION === */
.features-section { padding: 80px 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
}
.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background-color: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}
.feature-card h3 { margin-bottom: 0.5rem; }

/* === SUBSCRIPTION CTA SECTION (replaces donation) === */
.donation-section {
    padding: 80px 0;
    background-color: var(--bg-subtle);
    text-align: center;
}
.donation-content h2 { font-size: 2.2rem; }
.donation-content p {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    font-size: 1.1rem;
}
.donate-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* === CONTACT FORM === */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Contact email block */
.contact-info-email {
    text-align: center;
    margin-top: 2.5rem;
    padding: 20px;
    background-color: var(--bg-subtle);
    border-radius: 12px;
}
.contact-info-email p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}
.contact-info-email a {
    font-weight: 500;
    margin: 0 10px;
}

/* === BLOG PAGE LAYOUT & SIDEBAR === */
.blog-layout-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: flex-start;
}
.blog-sidebar {
    position: sticky;
    top: 95px;
    height: fit-content;
}
.sidebar-cta {
    background-color: var(--bg-subtle);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
}
.sidebar-cta h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}
.sidebar-cta p {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}
.sidebar-cta-link {
    background: var(--primary);
    color: white !important;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    display: inline-block;
}

/* === SINGLE BLOG POST (if needed later) === */
.blog-post-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 800px;
    width: 100%;
}
.post-header {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.post-header .back-to-blog {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.post-header .back-to-blog i { margin-right: 8px; }
.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.post-header .post-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === FOOTER === */
.footer {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 60px 0 0;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: var(--text-secondary); }

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 1.5rem;
}
.social-links a {
    width: 40px;
    height: 40px;
    background: var(--bg-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.social-links a:hover {
    background-color: var(--primary);
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === RESPONSIVE STYLES === */
@media (max-width: 992px) {
    .hero-content h2 { font-size: 2.8rem; }

    .blog-layout-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .blog-sidebar {
        position: static;
        max-width: 500px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    main { padding-top: 65px; }

    .logo-img { height: 36px; }
    .logo-text h1 { font-size: 1.1rem; }
    .logo-text p { font-size: 0.7rem; }
    .header-actions { gap: 15px; }
    .mobile-menu-btn { font-size: 1.4rem; }

    .navbar {
        position: fixed;
        top: 65px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 65px);
        background-color: var(--bg-main);
        transition: left var(--transition);
        padding: 30px;
    }
    .navbar.active { left: 0; }
    .navbar ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .mobile-menu-btn { display: block; }

    .hero-content h2 { font-size: 2.2rem; }
    .section-title { font-size: 2rem; }

    .btn-primary { padding: 12px 24px; font-size: 0.95rem; }
    .btn-secondary { padding: 10px 20px; font-size: 0.9rem; }
    .donate-btn-large { padding: 12px 24px; font-size: 1rem; }

    .tools-grid,
    .blog-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    .blog-post-content { padding: 20px; }
    .post-header h1 { font-size: 2rem; }
}

@media (max-width: 576px) {
    .hero { padding: 60px 0; }

    .hero-content h2 { font-size: 2.0rem; }
    .hero-content p { font-size: 1.1rem; }

    .footer-grid { grid-template-columns: 1fr; }
}

/* Simple status message styles (used in auth forms) */
.form-status {
    margin-top: 1rem;
    font-weight: 500;
}
.form-status.success { color: #28a745; }
.form-status.error { color: #dc3545; }