/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* CSS Variables for Easy Theme Management */
:root {
    --primary-color: #0057D9;
    --accent-color: #F4B400;
    --background-color: #F9FAFB;
    --text-color: #111827;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    --white: #FFFFFF;
}

/* Basic Reset & Body Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Reusable Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}



/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 700px; /* Wider for new text */
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #0045b0;
}

/* --- Features Section --- */
.features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.feature-item {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.feature-item h3 {
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
}

.feature-item p {
    color: var(--text-light);
}

/* --- Tool Section --- */
.tool-section {
    padding: 80px 0;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tool-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-section .section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tool-container {
    background: var(--background-color);
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    text-align: center;
}

/* --- Styling for the Uploader inside the Tool Section --- */
#uploadForm input[type="file"] { border: 2px dashed var(--border-color); padding: 20px; width: 100%; border-radius: 8px; background: var(--white); cursor: pointer; }
#uploadForm button { background-color: var(--primary-color); color: white; border: none; padding: 12px 20px; width: 100%; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; margin-top: 20px; }
#uploadForm button:hover { background-color: #0045b0; }
#imagePreview { max-width: 100%; max-height: 250px; margin-top: 20px; border-radius: 4px; border: 1px solid var(--border-color); display: none; object-fit: contain; }
#result { margin-top: 20px; text-align: left; }
#linkBox { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; margin-top: 5px; background: var(--white); }
#copyBtn { width: 100%; background: #28a745; color: white; border: none; padding: 12px 20px; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; margin-top: 10px; }
#copyBtn:hover { background: #218838; }
#status { margin-top: 15px; font-style: italic; color: var(--text-light); height: 20px; }

/* --- Coming Soon Section --- */
.coming-soon { padding: 80px 0; text-align: center; }
.coming-soon h2 { font-size: 2.5rem; margin-bottom: 3rem; }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.tool-card { background: var(--white); padding: 30px; border-radius: 8px; border: 1px solid var(--border-color); position: relative; opacity: 0.6; }
.tool-card h3 { font-size: 1.5rem; }
.soon-badge { position: absolute; top: 15px; right: 15px; background-color: var(--accent-color); color: var(--text-color); padding: 5px 10px; font-size: 0.8rem; font-weight: 600; border-radius: 12px; }

/* --- Footer --- */
.main-footer { background-color: var(--white); padding: 40px 0; border-top: 1px solid var(--border-color); text-align: center; }
.main-footer .container { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.footer-links a { color: var(--text-light); text-decoration: none; margin: 0 15px; }
.footer-links a:hover { color: var(--primary-color); }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .features-grid, .tools-grid { grid-template-columns: 1fr; }
    .main-header .container { flex-direction: row; gap: 20px; }
    .main-nav ul { gap: 20px; padding-bottom: 5px; }
    .features-grid-detailed {grid-template-columns: auto !Important;}
    .content-wrapper h2 {font-size: 1.5rem !important;}
}

/* ================================================== */
/* === NEW STYLES for Downloader Page Redesign ==== */
/* ================================================== */

/* Container for the extra content below the tool */
.content-wrapper {
    background-color: var(--white);
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

/* General H2 style for all sections */
.content-wrapper h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 15px;
}
/* Underline effect for H2 */
.content-wrapper h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* --- How-To Steps Section --- */
.how-to-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 80px; /* More space between sections */
}
.step {
    text-align: center;
    padding: 30px;
}
.step-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.step h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.step p {
    color: var(--text-light);
    line-height: 1.7; /* Better line spacing */
}

/* --- Features Section --- */
.features-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}
.feature-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
}
.feature-card .icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}
.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}
.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* --- FAQ Section --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden; /* Important for the transition */
    padding: 30px;
}
.faq-question {
    padding: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}
.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease;
    color: var(--text-light);
    line-height: 1.7;
}
.faq-answer p {
    padding: 0 20px 20px 20px;
}
.faq-item.active .faq-answer {
    max-height: 200px; /* Adjust if answers are very long */
    padding-bottom: 0;
}

/* ========================================================== */
/* === DEFINITIVE HEADER, NAVIGATION & SUBMENU STYLES V6 ==== */
/* ========================================================== */

/* --- Main Header Container --- */
.main-header { background: var(--white); padding: 1rem 0; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 40px; }

/* --- Base Navigation Styles --- */
.main-nav ul { list-style: none; display: flex; gap: 30px; padding: 0; margin: 0; align-items: center; }
.main-nav a { text-decoration: none; color: var(--text-color); font-weight: 600; padding: 5px 0; position: relative; transition: color 0.3s ease; display: flex; align-items: center; }
.main-nav a:hover { color: var(--primary-color); }
.main-nav li.active > a { color: var(--primary-color); }
.main-nav a::after { content: ''; position: absolute; width: 100%; height: 2px; bottom: -2px; left: 0; background-color: var(--primary-color); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.3s ease-out; }
.main-nav li.active > a::after, .main-nav a:hover::after { transform: scaleX(1); transform-origin: bottom left; }

/* --- Desktop Dropdown Submenu --- */
.has-submenu { position: relative; }
.has-submenu .desktop-arrow { width: 16px; height: 16px; margin-left: 5px; transition: transform 0.3s ease; }
.has-submenu:hover .desktop-arrow { transform: rotate(180deg); }
.has-submenu .mobile-arrow { display: none; } /* Hide mobile arrow on desktop */
ul.submenu {
    position: absolute; top: 150%; left: 50%; transform: translateX(-50%);
    background-color: var(--white); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 10px; min-width: 240px; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, top 0.3s ease, visibility 0.3s;
    z-index: 100; display: flex; flex-direction: column; gap: 5px;
}
.has-submenu:hover .submenu { opacity: 1; visibility: visible; top: 100%; }
.submenu li { width: 100%; }
.submenu li a { display: block; padding: 12px 20px; white-space: nowrap; border-radius: 6px; }
.submenu li a:hover { background-color: var(--background-color); }
.submenu li a::after { display: none; }

/* --- Hamburger Button --- */
.hamburger { display: none; }


/* ========================================================== */
/* === DEFINITIVE HEADER, NAVIGATION & SUBMENU STYLES V7 ==== */
/* ========================================================== */

/* --- Main Header Container --- */
.main-header { background: var(--white); padding: 1rem 0; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 40px; }

/* --- Desktop Navigation --- */
.desktop-nav ul { list-style: none; display: flex; gap: 30px; padding: 0; margin: 0; align-items: center; }
.desktop-nav a { text-decoration: none; color: var(--text-color); font-weight: 600; padding: 5px 0; position: relative; transition: color 0.3s ease; display: flex; align-items: center; }
.desktop-nav a:hover { color: var(--primary-color); }
.desktop-nav .has-submenu { position: relative; }
.desktop-nav .desktop-arrow { width: 16px; height: 16px; margin-left: 5px; transition: transform 0.3s ease; }
.desktop-nav .has-submenu:hover .desktop-arrow { transform: rotate(180deg); }
.desktop-nav .submenu { list-style: none; position: absolute; top: 150%; left: 50%; transform: translateX(-50%); background-color: var(--white); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); padding: 10px; min-width: 240px; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, top 0.3s ease, visibility 0.3s; z-index: 100; display: flex; flex-direction: column; gap: 5px; }
.desktop-nav .has-submenu:hover .submenu { opacity: 1; visibility: visible; top: 100%; }
.desktop-nav .submenu li { width: 100%; }
.desktop-nav .submenu li a { display: block; padding: 12px 20px; white-space: nowrap; border-radius: 6px; }
.desktop-nav .submenu li a:hover { background-color: var(--background-color); }

/* Hide Mobile Elements on Desktop */
.hamburger, .mobile-nav, .menu-overlay { display: none; }

/* ======================================= */
/* === MOBILE & RESPONSIVE STYLES      === */
/* ======================================= */
@media (max-width: 900px) {
    .desktop-nav { display: none; } /* Hide desktop nav */
    .hamburger { display: flex; flex-direction: column; justify-content: space-around; width: 2.25rem; height: 2rem; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 1001; }
    .hamburger .bar { width: 2rem; height: 0.25rem; background-color: var(--text-color); border-radius: 10px; transition: all 0.3s ease; }

    /* --- Mobile Slide-in Menu --- */
    .mobile-nav {
        display: block; position: fixed; top: 0; left: 0;
        width: 280px; height: 100%;
        background-color: var(--white);
        box-shadow: 0 0 30px rgba(0,0,0,0.2);
        z-index: 1002;
        padding: 60px 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
    }
    .mobile-nav.open { transform: translateX(0); }
    .mobile-nav .close-btn { position: absolute; top: 15px; right: 20px; font-size: 2.5rem; background: none; border: none; cursor: pointer; color: var(--text-color); }
    .mobile-nav ul { list-style: none; padding: 0; margin: 0; }
    .mobile-nav li a {
        display: flex; justify-content: space-between; align-items: center;
        padding: 15px 30px; text-decoration: none; color: var(--text-color);
        border-bottom: 1px solid var(--border-color); font-weight: 600;
    }
    .mobile-nav li a:hover { background-color: var(--background-color); }
    .mobile-nav .mobile-arrow { font-size: 1.2rem; font-weight: normal; transition: transform 0.3s ease; }
    .mobile-nav .has-submenu.open > a .mobile-arrow { transform: rotate(90deg); }
    .mobile-nav .submenu {
        list-style: none; padding-left: 15px;
        background-color: var(--background-color);
        max-height: 0; overflow: hidden;
        transition: max-height 0.4s ease-out;
    }
    .mobile-nav .has-submenu.open > .submenu { max-height: 500px; overflow: auto; }
    .mobile-nav .submenu a { font-weight: normal; font-size: 0.9em; }

    /* --- Menu Background Overlay --- */
    .menu-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1001; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s; }
    .menu-overlay.open { opacity: 1; visibility: visible; }
    .main-nav ul { display: block; }
}

/* --- NEW Blog Card Styles with Images --- */
.blog-post-card {
    background: var(--white); border: 1px solid var(--border-color);
    border-radius: 12px; text-decoration: none; color: var(--text-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; overflow: hidden;
}
.blog-post-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); }
.blog-post-card .card-image-container {
    width: 100%;
    height: 200px; /* Fixed height for all images */
    overflow: hidden;
}
.blog-post-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This crops the image to fit without stretching */
    transition: transform 0.4s ease;
}
.blog-post-card:hover .card-image {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}
.blog-post-card .card-content { padding: 25px; }
.blog-post-card h3 { font-size: 1.4rem; margin-top: 0; margin-bottom: 0.5rem; }
.blog-post-card p { color: var(--text-light); }

/* --- Blog Post Article Styles --- */

/* ... your existing article styles ... */
/* --- Blog Post Article Styles --- */
.article-content { max-width: 900px; margin: 0 auto; }
.article-content h2 { font-size: 1.8rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.article-content p, .article-content li { font-size: 1.1rem; line-height: 1.8; color: var(--text-light); margin-bottom: 1.5rem; }
.article-content a { color: var(--primary-color); text-decoration: underline; }
.article-content ul, .article-content ol { padding-left: 25px; }
.article-content strong { color: var(--text-color); }
.article-content pre { background-color: #f0f2f5; padding: 20px; border-radius: 8px; white-space: pre-wrap; word-wrap: break-word; font-family: monospace; margin-bottom: 1.5rem;}
/*Custom CSS*/
.article-page {Padding: 50px 0;}
.article-featured-image img { margin: 30px 0; width: 100%; height: auto; max-height: 600px; object-fit: cover; border-radius: 12px; }

/* --- Article Metadata Styles --- */
.article-meta {
    text-align: center;
    margin: 0rem 0 2rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
}
.article-meta .separator {
    margin: 0 10px;
}

/* ========================================= */
/* === SIDEBAR STYLES (POLISHED V5)      === */
/* ========================================= */

.page-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: #f9fafb;
}

/* Sidebar Box */
.tool-sidebar {
    width: 280px; /* Slightly narrower for a cleaner look */
    background: #fff;
    border-right: 1px solid var(--border-color);
    padding: 20px 12px; /* Less side padding */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    
    /* Sticky Logic */
    position: sticky;
    top: 74px;
    height: calc(100vh - 74px);
    overflow-y: auto;
}

/* "TOOL CATEGORIES" Label */
.sidebar-main-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #adb5bd; /* Softer gray */
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0 12px 15px 12px;
    margin-bottom: 5px;
}

/* Category Headers */
.nav-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
    margin-bottom: 2px;
}

.nav-cat-header:hover {
    background-color: #f3f4f6;
}

.nav-category.open .nav-cat-header {
    color: var(--text-dark); /* Keep text dark */
}

.header-left { display: flex; align-items: center; gap: 10px; }

/* Category Icons */
.cat-icon { 
    font-size: 1.1rem; 
    width: 24px; 
    display: flex; 
    justify-content: center;
}

.cat-chevron {
    font-size: 0.7rem;
    color: #adb5bd;
    transition: transform 0.2s ease;
}
.nav-category.open .cat-chevron { transform: rotate(180deg); }

/* Tool Lists Container */
.nav-cat-list {
    list-style: none !important;
    padding: 0;
    margin: 2px 0 10px 0;
}

/* Tool Links */
.nav-cat-list a {
    display: flex;
    align-items: center;
    /* Indentation Logic: 12px padding + 24px icon width + 10px gap = ~46px indent */
    padding: 8px 12px 8px 46px; 
    text-decoration: none;
    color: #6b7280;
    font-size: 0.9rem;
    border-radius: 8px; /* Rounded corners ("Pill" shape) */
    transition: all 0.1s;
    margin-bottom: 1px;
}

/* Tool Icons */
.tool-icon {
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
    text-align: center;
    display: inline-block;
    opacity: 0.8;
}

/* Hover State */
.nav-cat-list a:hover {
    color: var(--text-dark);
    background-color: #f3f4f6;
}

/* ACTIVE STATE (The Fix) */
.nav-cat-list a.active {
    background-color: #eef2ff; /* Very light primary color */
    color: var(--primary-color);
    font-weight: 600;
}
.nav-cat-list a.active .tool-icon {
    opacity: 1;
}

/* Scrollbar beautification for sidebar */
.tool-sidebar::-webkit-scrollbar { width: 5px; }
.tool-sidebar::-webkit-scrollbar-thumb { background: #eee; border-radius: 4px; }
.tool-sidebar::-webkit-scrollbar-thumb:hover { background: #ddd; }

/* Mobile Logic */
.sidebar-toggle-btn { display: none; }
.sidebar-header-mobile { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 1024px) {
    .page-wrapper { display: block; }
    .tool-sidebar {
        position: fixed; top: 0; left: -320px;
        width: 280px; height: 100vh; z-index: 1000;
        box-shadow: 5px 0 20px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }
    .tool-sidebar.open { left: 0; }
    
    .sidebar-toggle-btn {
        display: flex; align-items: center; gap: 8px;
        position: fixed; bottom: 20px; left: 20px;
        background: var(--primary-color); color: white; border: none;
        padding: 12px 20px; border-radius: 50px; font-weight: 600;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2); z-index: 900; cursor: pointer;
    }
    
    .sidebar-header-mobile {
        display: flex; justify-content: space-between; align-items: center;
        padding: 20px 15px; border-bottom: 1px solid #eee; font-weight: 700; font-size: 1.1rem;
    }
    #sidebar-close { background:none; border:none; font-size:1.5rem; cursor:pointer; padding: 5px; }
    
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 999; display: none;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.open { display: block; }
}

/* ========================================= */
/* === LAYOUT FIX: FULL WIDTH SIDEBAR    === */
/* ========================================= */

.page-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
    width: 100%;       /* Forces full width */
    max-width: 100%;   /* Removes the 1400px restriction */
    margin: 0;         /* Removes the centering margin */
    background-color: #f9fafb;
}

/* Optional: Keep the tool content from stretching too wide on huge screens */
.main-content {
    flex-grow: 1;
    min-width: 0;
    /* Keeps the tool centered inside the remaining space */
    max-width: 100%; 
    margin: 0 auto; 
}

/* ======================== */
/* === LANGUAGE SWITCHER === */
/* ======================== */

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px; /* Space from menu */
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-link {
    text-decoration: none;
    color: var(--text-light); /* Gray by default */
    transition: color 0.2s;
    text-transform: uppercase;
}

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

.lang-link.active {
    color: var(--text-dark); /* Black/Dark for active */
    font-weight: 800;
}

.lang-sep {
    color: #e5e7eb; /* Light gray line */
    font-weight: 300;
}

/* Mobile Adjustments */
.mobile-nav .lang-switcher {
    margin: 0;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

/* Enable smooth scrolling across the site */
html {
    scroll-behavior: smooth;
}

/* Ensure section titles aren't covered by the sticky header */
.category-section {
    scroll-margin-top: 90px; /* Adjust this based on your header height */
}