/* --- 1. Premium Theme & Dark Theme Variables --- */
:root {
    --primary-color: #3a86ff;
    --primary-gradient: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
    --primary-text-color: #ffffff;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #5a647e;
    --heading-color: #1c2a4e;
    --subtle-text-color: #8a94a6;
    --shadow-color: rgba(28, 42, 78, 0.08);
    --shadow-hover-color: rgba(28, 42, 78, 0.15);
    --border-color: #e8eaf0;
    --font-family: 'Poppins', 'Segoe UI', 'Roboto', sans-serif;
}

[data-theme="dark"] {
    --primary-color: #3a86ff;
    --primary-gradient: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
    --primary-text-color: #ffffff;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --text-color: #adb5bd;
    --heading-color: #f8f9fa;
    --subtle-text-color: #868e96;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover-color: rgba(0, 0, 0, 0.5);
    --border-color: #343a40;
}

/* --- 2. Global Setup --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--background-color); color: var(--text-color); line-height: 1.6; transition: background-color 0.3s ease, color 0.3s ease; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 3. Header, Logo, and Desktop Nav --- */
header { background-color: var(--card-background); box-shadow: 0 2px 10px var(--shadow-color); padding: 1rem 0; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border-color); transition: background-color 0.3s ease, border-color 0.3s ease; }
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo { height: 40px; width: auto; }
.logo-container h1, .logo-container h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.desktop-nav { display: none; }
.desktop-nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; }
.desktop-nav a { text-decoration: none; color: var(--text-color); font-weight: 500; transition: color 0.2s ease; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--primary-color); }

/* --- 4. Theme Toggle Button --- */
.theme-toggle-btn { background-color: var(--background-color); border: 1px solid var(--border-color); color: var(--text-color); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1rem; transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease; }
.theme-toggle-btn:hover { background-color: var(--border-color); transform: scale(1.1); }

/* --- 5. Featured Tool Section (Homepage) --- */
.featured-tool { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; background-color: var(--card-background); padding: 2rem; border-radius: 16px; margin-bottom: 4rem; border: 1px solid var(--border-color); }
.featured-content .badge { display: inline-block; background: var(--primary-gradient); color: var(--primary-text-color); padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; margin-bottom: 1rem; }
.featured-content h2 { font-size: 2.5rem; color: var(--heading-color); margin-bottom: 1rem; line-height: 1.2; }
.featured-content p { margin-bottom: 1.5rem; font-size: 1rem; }
.featured-image img { width: 100%; height: auto; border-radius: 12px; object-fit: cover; }
.btn-primary {
    display: inline-block;
    background: var(--primary-gradient);
    color: var(--primary-text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background-size: 200% auto;
    transition: background-position 0.4s ease, transform 0.2s ease;
}
.btn-primary:hover { background-position: right center; transform: translateY(-2px); }

/* --- 6. Main Content and Tool Grid (Homepage) --- */
main { padding: 3rem 0; }
.section-title { font-size: 2rem; font-weight: 600; color: var(--heading-color); text-align: center; margin-bottom: 2.5rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.tool-card {
    background-color: var(--card-background);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.tool-card:hover { transform: translateY(-10px); box-shadow: 0 12px 30px var(--shadow-hover-color); }
.tool-card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.tool-card-content { padding: 1.5rem; text-align: center; flex-grow: 1; display: flex; flex-direction: column; }
.tool-card-content h3 { color: var(--heading-color); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.tool-card-content p { color: var(--subtle-text-color); font-size: 0.9rem; flex-grow: 1; }

/* --- 7. Ad Placeholders & Layouts (Optimized for Performance) --- */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    border: 1px dashed var(--border-color);
    color: var(--subtle-text-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 auto;
    min-width: 300px;
    min-height: 50px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.medium-rectangle-ad .ad-placeholder {
    width: 300px;
    height: 250px;
}
.leaderboard-ad .ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
}
.leaderboard-ads-section { display: flex; flex-direction: column; gap: 1.5rem; margin: 4rem 0; }

/* Generic Page Layout with Sidebar */
.page-layout-container { display: flex; gap: 2rem; align-items: flex-start; }
.page-main-content { flex: 1; min-width: 0; }
.page-sidebar {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}
.sidebar-ad {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: calc(300px + 2rem); 
    margin: 0 auto 1.5rem auto; 
}
.sidebar-ad h4 {
    color: var(--subtle-text-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
}

/* Mobile-only Ad Containers */
.mobile-ad-container, .blog-mobile-ad, .blog-post-mobile-ad { display: none; }

/* --- 8. Video Tutorial Section (Homepage) --- */
.video-tutorial { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; margin: 4rem 0 2rem 0; }
.video-thumbnail { position: relative; cursor: pointer; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px var(--shadow-hover-color); background-color: #1c2a4e; background-repeat: no-repeat; background-position: center center; background-size: cover; aspect-ratio: 16 / 9; display: flex; justify-content: center; align-items: center; }
.video-thumbnail::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.2); transition: background-color 0.3s ease; }
.video-thumbnail:hover::before { background-color: rgba(0, 0, 0, 0.4); }
.play-button { position: relative; z-index: 2; width: 80px; height: 80px; background-color: rgba(255, 255, 255, 0.9); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--primary-color); font-size: 2rem; transition: transform 0.3s ease, background-color 0.3s ease; padding-left: 5px; }
.video-thumbnail:hover .play-button { transform: scale(1.1); background-color: #fff; }
.video-content .section-title { text-align: left; margin-bottom: 1rem; }
.video-cta-btn { margin-top: 1.5rem; }

/* --- 9. Video Modal (Lightbox) --- */
.video-modal { display: none; position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); justify-content: center; align-items: center; }
.video-modal.modal-active { display: flex; }
.modal-content { position: relative; width: 90%; max-width: 800px; }
.close-modal { position: absolute; top: -40px; right: 0; color: #fff; font-size: 2.5rem; font-weight: bold; cursor: pointer; transition: color 0.2s ease; }
.close-modal:hover { color: #ccc; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; background-color: #000; border-radius: 8px; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- 10. Footer --- */
footer { background-color: var(--card-background); padding: 3rem 0 1.5rem 0; margin-top: 3rem; border-top: 1px solid var(--border-color); color: var(--subtle-text-color); }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand .logo { height: 35px; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; max-width: 300px; }
.footer-links h4 { color: var(--heading-color); font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 0.5rem; }
.footer-links ul a { text-decoration: none; color: var(--subtle-text-color); transition: color 0.2s ease; }
.footer-links ul a:hover { color: var(--primary-color); }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border-color); font-size: 0.85rem; }

/* --- 11. Content Page Styles (About, Privacy, Terms, Blog Post) --- */
.content-page-section { background-color: var(--card-background); padding: 3rem 2rem; border-radius: 16px; border: 1px solid var(--border-color); }
.content-page-section h1 { font-size: 2.5rem; color: var(--heading-color); margin-bottom: 1rem; text-align: center; }
.content-page-section h2 { font-size: 1.75rem; color: var(--heading-color); margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 2px solid var(--primary-color); padding-bottom: 0.5rem; }
.content-page-section h3 { font-size: 1.4rem; color: var(--heading-color); margin-top: 2rem; margin-bottom: 1rem; }
.content-page-section p, .content-page-section li { font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; }
.content-page-section ul { list-style-position: inside; padding-left: 1rem; }
.content-page-section a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.content-page-section a:hover { text-decoration: underline; }
.content-page-section small { color: var(--subtle-text-color); }
.content-page-section .blog-meta { text-align: center; color: var(--subtle-text-color); margin-top: -0.5rem; margin-bottom: 2rem; font-style: italic; }

/* --- 12. Blog Index Page Styles --- */
.blog-page-header { text-align: center; margin-bottom: 3rem; }
.blog-page-header h1 { font-size: 2.8rem; color: var(--heading-color); }
.blog-page-header p { font-size: 1.1rem; color: var(--subtle-text-color); max-width: 600px; margin: 0.5rem auto 0; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.blog-card {
    background-color: var(--card-background);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.blog-card:hover { transform: translateY(-10px); box-shadow: 0 12px 30px var(--shadow-hover-color); }
.blog-card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--border-color); }
.blog-card-content { padding: 1.5rem; flex-grow: 1; }
.blog-card-content .category { display: inline-block; background: var(--primary-gradient); color: var(--primary-text-color); padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: 0.5px; }
.blog-card-content h3 { color: var(--heading-color); font-size: 1.25rem; margin-bottom: 0.5rem; }
.blog-card-content p { color: var(--text-color); font-size: 0.95rem; line-height: 1.6; }

/* --- 13. Contact Page Styles --- */
.contact-page-header { text-align: center; margin-bottom: 2rem; }
.contact-page-header h1 { font-size: 2.8rem; color: var(--heading-color); }
.contact-page-header p { font-size: 1.1rem; color: var(--subtle-text-color); max-width: 600px; margin: 0.5rem auto 0; }
.contact-info { text-align: center; margin-bottom: 2.5rem; background-color: var(--background-color); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-color); }
.contact-info h3 { color: var(--heading-color); margin-bottom: 1rem; font-size: 1.2rem; }
.contact-info p { margin-bottom: 0.5rem; }
.contact-info a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.contact-info a:hover { text-decoration: underline; }
.contact-form-container { background-color: var(--card-background); padding: 2rem; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 5px 15px var(--shadow-color); }
.contact-form .form-group { margin-bottom: 1.5rem; }
.contact-form label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--heading-color); }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--background-color); color: var(--text-color); font-family: var(--font-family); font-size: 1rem; transition: all 0.2s ease; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button { width: 100%; display: inline-block; background: var(--primary-gradient); color: var(--primary-text-color); padding: 0.85rem 1.5rem; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1rem; border: none; cursor: pointer; background-size: 200% auto; transition: background-position 0.4s ease, transform 0.2s ease; }
.contact-form button:hover:not(:disabled) { background-position: right center; transform: translateY(-2px); }
.contact-form button:disabled { opacity: 0.7; cursor: not-allowed; }
.form-status { margin-top: 1rem; font-weight: 500; text-align: center; min-height: 1.2em; }
.form-status.success { color: #28a745; }
.form-status.error { color: #dc3545; }

/* --- 14. Responsive Design --- */
@media (min-width: 769px) {
    .desktop-nav { display: block; }
}
@media (max-width: 992px) {
    .featured-tool { grid-template-columns: 1fr; }
    .featured-image { order: -1; margin-bottom: 2rem; }
    .featured-content h2 { font-size: 2rem; }
    .video-content .section-title { text-align: center; }
    .page-sidebar { display: none; }
    
    .mobile-ad-container, .blog-post-mobile-ad {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin: 2.5rem auto;
        align-items: center;
    }
    .blog-mobile-ad {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        grid-column: 1 / -1;
    }
}
@media (max-width: 768px) {
    .logo-container h1, .logo-container h2 { font-size: 1.25rem; }
    .featured-tool { display: none; }
    .video-tutorial { grid-template-columns: 1fr; gap: 1.5rem; }
    .video-content { text-align: center; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-brand { grid-column: 1 / -1; text-align: center; margin-bottom: 1rem; }
    .footer-brand p { margin: 0 auto; font-size: 0.85rem; }
    .footer-links { text-align: center; }
    .footer-links h4 { font-size: 0.9rem; }
    .footer-links ul a { font-size: 0.85rem; }
    
    .leaderboard-ad .ad-placeholder {
        max-width: 320px;
        height: 50px;
    }
}

/* --- 15. Sticky Social Share Bar --- */
.social-share-sticky {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-share-sticky a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.social-share-sticky a:hover {
    transform: scale(1.15);
    color: #ffffff;
}

.social-share-sticky a:hover .fa-facebook-f { background-color: #1877F2; }
.social-share-sticky a:hover .fa-twitter { background-color: #1DA1F2; }
.social-share-sticky a:hover .fa-linkedin-in { background-color: #0A66C2; }
.social-share-sticky a:hover .fa-envelope { background-color: #7f8c8d; }

.social-share-sticky a:hover i {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

@media (max-width: 1200px) {
    .social-share-sticky {
        display: none;
    }
}