/* === FONT & THEME VARIABLES (Updated for EasyMyInvoice) === */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hue-primary: 210; /* Blue, matches #0d6efd */
    --transition: 0.3s ease;

    /* === NEW: Attractive Light Mode === */
    --bg-main: #f9faff; /* Lighter, more premium background */
    --bg-glass: rgba(255, 255, 255, 0.5); /* Refined glass effect */
    --bg-card: #ffffff;
    --bg-subtle: #f0f4ff; /* Softer subtle color */
    --border: rgba(0, 0, 0, 0.07); /* Softer border */
    --text-primary: #1a202c;
    --text-secondary: #5a677d;
    --shadow-color: 220, 40%, 50%;
    --primary: hsl(var(--hue-primary), 85%, 55%);
    --primary-dark: hsl(var(--hue-primary), 85%, 45%);
    --grad-1: #d9e7ff; /* Lighter, more vibrant gradient color */
    --grad-2: #e0d8ff; /* Lighter, more vibrant gradient color */
}

.dark-mode {
    /* Dark Mode */
    --bg-main: #131824;
    --bg-glass: rgba(22, 33, 62, 0.4);
    --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: #020024;
    --grad-2: #090979;
}

/* === 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 from Tool */
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 {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}
main { padding-top: 75px; }

/* === 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: 1.5rem; }
.section-subtitle {
    text-align: center;
    max-width: 600px;
    /* UPDATE: Reduced bottom margin from 3rem to 2rem to close the gap */
    margin: -1rem auto 2rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}
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); }

/* === NEW: Attractive Gradient Button === */
.btn-primary {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    background-image: linear-gradient(45deg, hsl(var(--hue-primary), 95%, 65%), hsl(var(--hue-primary), 85%, 50%));
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(var(--shadow-color), 0.2);
    transition: all var(--transition);
    text-align: center;
    background-size: 150% auto;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--shadow-color), 0.3);
    background-position: right center;
}
.btn-hero {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
}

.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 & GLASSMORPHISM UI === */
.header, .tool-card, .feature-card, .ad-banner, .contact-form, .blog-post-content, .sidebar-ad {
    background-color: var(--bg-glass);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transition: background-color var(--transition), border var(--transition);
}

.header {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    padding: 10px 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}
.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; }

/* === AD SECTION === */
.ad-section { padding: 20px 0; }
.ad-banner { padding: 15px; text-align: center; position: relative; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.ad-banner span { position: absolute; top: 10px; right: 15px; font-size: 0.7rem; color: var(--text-secondary); }
.ad-placeholder { background-color: var(--bg-subtle); height: 80px; border-radius: 8px; }

/* === FEATURES & 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 { 
    /* MODIFICATION START: Changed display to flex for better internal alignment */
    display: flex; 
    flex-direction: column;
    /* MODIFICATION END */
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(var(--shadow-color), 0.04), 0 10px 25px rgba(var(--shadow-color), 0.08);
    text-decoration: none; 
}
.tool-card:hover, .blog-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 6px 12px rgba(var(--shadow-color), 0.06), 0 15px 35px 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; transition: transform 0.4s ease; }
.tool-card:hover img, .blog-card:hover img { transform: scale(1.05); }
.tool-info { padding: 25px; }
.tool-info h3 { margin-bottom: 0.5rem; color: var(--text-primary); }
.tool-info p { font-size: 0.95rem; margin-bottom: 0; }

/* === Improved Blog Card Layout === */
.blog-card .blog-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    /* MODIFICATION START: Removed problematic justify-content and height, added flex-grow */
    flex-grow: 1; /* Allows this content area to fill the remaining space in the card */
    /* MODIFICATION END */
}
.blog-content h3 { margin-bottom: 0.5rem; color: var(--text-primary); }
.blog-content p { font-size: 0.95rem; margin-bottom: 1.5rem; }
.blog-category { font-size: 0.75rem; font-weight: 600; color: var(--primary); letter-spacing: 1px; margin-bottom: 0.5rem; display: block; }
.blog-link-wrapper { margin-top: auto; }
.blog-link { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.blog-link i { transition: transform 0.3s ease; }
.blog-card:hover .blog-link i { transform: translateX(4px); }
.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; }
.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;
    caret-color: transparent;
}

/* === WHY CHOOSE US SECTION === */
.features-section { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { padding: 30px; text-align: center; }
.feature-icon { width: 60px; height: 60px; margin: 0 auto 1.5rem; background-image: linear-gradient(45deg, hsl(var(--hue-primary), 85%, 55%), hsl(var(--hue-primary), 90%, 65%)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.feature-card h3 { margin-bottom: 0.5rem; }

/* === DONATION SECTION === */
.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; padding: 30px; }
.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); }

/* === BLOG PAGE & SINGLE POST === */
.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-ad { padding: 20px; text-align: center; }
.sidebar-ad h4 { margin-bottom: 1rem; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.sidebar-ad .ad-placeholder { min-height: 250px; height: auto; }
.blog-post-content { 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); }
.featured-image { margin: 2rem 0; border-radius: 12px; overflow: hidden; }
.featured-image img { width: 100%; height: auto; display: block; }
.post-body h2 { font-size: 1.8rem; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--text-primary); }
.post-body ul { list-style-position: inside; padding-left: 1rem; margin-bottom: 1.5rem; }
.post-body ul li { margin-bottom: 0.5rem; color: var(--text-secondary); }
.post-share { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; }
.post-share h3 { font-size: 1.2rem; color: var(--text-primary); }
.post-share .social-links { justify-content: center; }

/* === 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-newsletter { display: flex; margin-bottom: 1rem; }
.footer-newsletter input { flex: 1; padding: 10px 15px; border: 1px solid var(--border); border-radius: 50px 0 0 50px; outline: none; background-color: var(--bg-subtle); color: var(--text-primary); }
.footer-newsletter input:focus { border-color: var(--primary); }
.footer-newsletter button { background: var(--primary); color: #fff; border: none; padding: 0 20px; border-radius: 0 50px 50px 0; cursor: pointer; }
.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-hero { padding: 14px 28px; font-size: 1rem; }
    .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 1fr;
        gap: 30px 20px;
    }
    .footer-col-main, .footer-col-newsletter {
        grid-column: span 2;
        text-align: center;
    }
    .footer-col-main .social-links {
        justify-content: center;
    }
}