/* MASTER STYLESHEET: FlexTools Pro
   Branding: #f97316 (Orange) & #0ea5e9 (Blue)
*/

:root {
    --primary: #f97316;
    --secondary: #0ea5e9;
    --dark: #0f172a;
    --surface: #ffffff;
    --bg: #f8fafc;
    --text: #1e293b;
    --sub: #64748b;
    --glass: rgba(255, 255, 255, 0.7);
    --border: #e2e8f0;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}


html, body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    height: 101vh;
    overscroll-behavior-y: auto !important; 
    overflow-y: auto !important;
    height: auto !important;
}

/* --- SIDEBAR & NAVIGATION --- */
.sidebar {
    width: 290px;
    min-width: 290px;
    height: 100vh;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

/* LOGO FIX: Strictly constraining the logo size */
.main-logo {
    width: 12rem !important;
    height: auto !important;
    object-fit: contain;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
    color: var(--dark);
}

.mobile-close{display: none;}

.brand-name span { color: var(--primary); }

/* ACCORDION (FOLDERS) */
.nav-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.nav-group { margin-bottom: 15px; }

.group-header {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--sub);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px;
    transition: 0.2s;
}

.group-header:hover { background: #f1f5f9; color: var(--secondary); }

.group-content {
    display: none; /* Folders closed by default */
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 8px 10px;
}

.group-content.show { display: flex !important; }

.chevron { font-size: 0.6rem; transition: transform 0.3s; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-item:hover { background: #f1f5f9; color: var(--secondary); }
.nav-item.active { background: var(--secondary); color: white; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25); }

/* --- WORKSPACE & TOP BARS --- */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

/* Hide mobile-only header on desktop */
body > .top-bar { display: none; }

.status-pill {
    background: #f0fdf4;
    color: #16a34a;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #dcfce7;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- CONTENT AREA --- */
.content-area {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 30px 30px;
}

.tool-card {
    background: var(--surface);
    border-radius: 32px;
    padding: 50px;
    box-shadow: var(--shadow);
    max-width: 850px;
    margin: 0 auto;
    border: 1px solid var(--border);
    display: none;
}

.tool-card.active { display: block; animation: fadeIn 0.4s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- INPUTS & BUTTONS --- */
input, select {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 700;
    border: 1px #dcfce7 solid;
    background: #f8fafc;
}

.result-box {
    margin-top: 25px;
    padding: 20px;
    background: #f8fafc; /* Very light slate */
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

/* State when it has a result (Add this class via JS when calculated) */
.result-box.active {
    background: #f0fdf4; /* Light success green */
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

/* Styling the text inside the box */
.result-box {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Inter', monospace; /* Monospace looks better for numbers */
}

/* Label text (if you add "Result:" inside) */
.result-box small {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.btn-action {
    background: #16a34a;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-weight: 800;
    width: 100%;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
}

.bmc-header-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFDD00; /* Official BMC Yellow */
    padding: 8px 80px;
    border-radius: 12px;
    text-decoration: none !important; /* Removes blue underline */
    color: #000000 !important; /* Forces black text */
    font-weight: 800;
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(255, 221, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

/* Fixes the SVG logo inside the button */
.bmc-header-btn img {
    height: 18px !important;
    width: auto !important;
}

.bmc-header-btn span {
    color: #000000;
    letter-spacing: -0.2px;
}

/* Hover Effects */
.bmc-header-btn:hover {
    transform: translateY(-2px);
    background: #FFCC00;
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.4);
    color: #000000 !important;
}

.bmc-header-btn:active {
    transform: translateY(0);
}

/* Ensure no "visited" or "active" link colors appear */
.bmc-header-btn:visited, 
.bmc-header-btn:focus {
    color: #000000 !important;
    text-decoration: none !important;
}

.btn-action:hover { background: var(--secondary); transform: translateY(-2px); }


.section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 40px 0;
}

/* Spinner Styles */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Done/Error Message Toast */
.status-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}
.status-toast.success { background: #22c55e; }
.status-toast.error { background: #ef4444; }

@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* FAQ Section Styling */
.faq-list { margin-top: 20px; }
.faq-item { 
    margin-bottom: 12px; 
    border: 1px solid rgba(0,0,0,0.08); 
    border-radius: 12px; 
    background: #fdfdfd; 
    overflow: hidden; 
}
.faq-question { 
    padding: 16px 20px; 
    display: flex; 
    justify-content: space-between; 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--primary-color);
}
.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: all 0.3s ease; 
    padding: 0 20px; 
    color: #555; 
    font-size: 0.95rem;
    line-height: 1.6;
}
.faq-item.active .faq-answer { 
    max-height: 200px; 
    padding-bottom: 16px; 
}
.faq-item.active .faq-icon { transform: rotate(45deg); color: #ff4d4d; }

/* Styling the pull-to-refresh container */
.ptr--ptr {
    background: #fdfdfd !important;
    color: #2c3e50 !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    box-shadow: none !important;
}

/* The loading text */
.ptr--text {
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Add a subtle fade-in for the refresh box */
.ptr--main {
    transition: opacity 0.3s ease;
}

/* --- SEO CONTENT CONTAINER --- */
.seo-content {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* --- HEADERS --- */
.seo-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
    text-align: center;
}

.seo-content p {
    font-size: 1rem;
    color: #475569;
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
}

/* --- FEATURES GRID --- */
.features-grid {
    display: grid;
    gap: 20px;
    margin: 40px 0;
}

.feature-item {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #f97316; /* FlexTools Orange */
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-item p {
    text-align: left;
    font-size: 0.95rem;
    margin: 0;
}

/* --- TRUST SECTION (The Bottom Highlight) --- */
.trust-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 30px;
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
    margin-top: 50px;
}

.trust-section h2 {
    color: #0ea5e9; /* Secure Blue */
}

/* --- 1. CHEVRON ROTATION (Your specific logic) --- */
.chevron {
    display: inline-block;
    transition: transform 0.3s ease; /* This makes the 180deg spin smooth */
    margin-left: auto;
    font-size: 0.8rem;
    pointer-events: none; /* Let the click pass through to the header */
}

/* --- UNIVERSAL REFRESHER --- */
.refresh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.refresh-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #f97316; /* Your Brand Orange */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- MOBILE PRODUCTION LAYOUT (900px and below) --- */
@media (max-width: 900px) {
    .mobile-top-bar { 
        display: flex !important; 
        position: fixed; top: 0; left: 0; right: 0; height: 60px;
        background: white; z-index: 1000; border-bottom: 1px solid #e2e8f0;
        padding: 0 20px; align-items: center; justify-content: space-between;
    }

    .sidebar {
        position: fixed;
        top: 0; left: 0; 
        width: 280px; height: 100vh;
        z-index: 5000;
        background: white;
        /* Start hidden off-screen using transform for performance */
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }

    .sidebar.open {
        transform: translate3d(0, 0, 0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 4000;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .result-box {
        font-size: 1.25rem;
        padding: 15px;
        margin-top: 20px;
    }

    /* 1. THE WORKSPACE (Keep the Card look for the Tool only) */
    .tool-box {
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 20px !important;
        padding: 24px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 40px !important;
        display: block !important;
    }

    /* 2. THE SEO & FAQ (Remove Cards - Match the "Digital Toolkit" text) */
    .seo-content, .faq-container, .trust-section {
        width: 100% !important;
        padding: 0 24px !important; /* Matches the margin in your screenshot */
        background: transparent !important;
        display: block !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 3. STRIP FAQ ITEMS (No more cards inside cards) */
    .faq-item, .feature-item {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 32px !important; /* Professional breathing room */
        width: 100% !important;
        display: block !important;
    }

    /* 4. FIX "MESSED UP" TEXT (Ensure full-width flow) */
    .faq-question, .feature-item h3, .seo-content h2, .trust-section h2 {
        font-size: 22px !important; /* Bold like your screenshot */
        font-weight: 800;
        color: #0f172a;
        text-align: left !important;
        margin-bottom: 12px;
        display: block !important;
        width: 100% !important;
    }

    .faq-answer, .feature-item p, .seo-content p, .trust-section p {
        font-size: 16px !important;
        line-height: 1.6;
        color: #475569;
        text-align: left !important;
        display: block !important;
        width: 100% !important;
    }
}

/* --- DESKTOP PROTECTION --- */
@media (min-width: 901px) {
    .mobile-top-bar, .sidebar-overlay, .mobile-close { display: none !important; }
    .sidebar { transform: none !important; position: fixed; left: 0; width: 280px; }
    .workspace { margin-left: 280px; width: calc(100% - 280px); }
}

@media (min-width: 768px) {
    .result-box {
        font-size: 1.25rem;
        padding: 15px;
        margin-top: 20px;
    }

   /* 1. THE WORKSPACE (Keep the Card look for the Tool only) */
    .tool-box {
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 20px !important;
        padding: 24px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 40px !important;
        display: block !important;
    }

    /* 2. THE SEO & FAQ (Remove Cards - Match the "Digital Toolkit" text) */
    .seo-content, .faq-container, .trust-section {
        width: 100% !important;
        padding: 0 24px !important; /* Matches the margin in your screenshot */
        background: transparent !important;
        display: block !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 3. STRIP FAQ ITEMS (No more cards inside cards) */
    .faq-item, .feature-item {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 32px !important; /* Professional breathing room */
        width: 100% !important;
        display: block !important;
    }

    /* 4. FIX "MESSED UP" TEXT (Ensure full-width flow) */
    .faq-question, .feature-item h3, .seo-content h2, .trust-section h2 {
        font-size: 22px !important; /* Bold like your screenshot */
        font-weight: 800;
        color: #0f172a;
        text-align: left !important;
        margin-bottom: 12px;
        display: block !important;
        width: 100% !important;
    }

    .faq-answer, .feature-item p, .seo-content p, .trust-section p {
        font-size: 16px !important;
        line-height: 1.6;
        color: #475569;
        text-align: left !important;
        display: block !important;
        width: 100% !important;
    }
}

/* Small Mobile Screens (below 380px) */
@media (max-width: 380px) {
    .result-box {
        font-size: 1.25rem;
        padding: 15px;
        margin-top: 20px;
    }

   /* 1. THE WORKSPACE (Keep the Card look for the Tool only) */
    .tool-box {
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 20px !important;
        padding: 24px !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 40px !important;
        display: block !important;
    }

    /* 2. THE SEO & FAQ (Remove Cards - Match the "Digital Toolkit" text) */
    .seo-content, .faq-container, .trust-section {
        width: 100% !important;
        padding: 0 24px !important; /* Matches the margin in your screenshot */
        background: transparent !important;
        display: block !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 3. STRIP FAQ ITEMS (No more cards inside cards) */
    .faq-item, .feature-item {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 32px !important; /* Professional breathing room */
        width: 100% !important;
        display: block !important;
    }

    /* 4. FIX "MESSED UP" TEXT (Ensure full-width flow) */
    .faq-question, .feature-item h3, .seo-content h2, .trust-section h2 {
        font-size: 22px !important; /* Bold like your screenshot */
        font-weight: 800;
        color: #0f172a;
        text-align: left !important;
        margin-bottom: 12px;
        display: block !important;
        width: 100% !important;
    }

    .faq-answer, .feature-item p, .seo-content p, .trust-section p {
        font-size: 16px !important;
        line-height: 1.6;
        color: #475569;
        text-align: left !important;
        display: block !important;
        width: 100% !important;
    }
    
}