/*
Theme Name: GooExam Minimal
Theme URI: https://gooexam.com/
Author: GooExam Team
Description: Fixed Dark Mode & Mobile Menu
Version: 4.0.2
*/

/* --- 1. CORE VARIABLES --- */
:root {
    --brand-blue: #1a73e8;
    --brand-dark: #202124;
    --brand-gray: #5f6368;
    --bg-body: #ffffff;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #dadce0;
    --star-gold: #fbbc04;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- DARK MODE OVERRIDES --- */
body.amp-dark-mode {
    --brand-dark: #e8eaed;
    --brand-gray: #9aa0a6;
    --bg-body: #202124;
    --bg-light: #292a2d;
    --bg-card: #303134;
    --border-color: #3c4043;
}

/* Apply Dark Mode Backgrounds */
body.amp-dark-mode, 
body.amp-dark-mode .site-header,
body.amp-dark-mode .mobile-menu-container {
    background-color: var(--bg-body) !important;
    color: var(--brand-dark);
}

/* Generic Cards Dark Mode */
body.amp-dark-mode .tool-card,
body.amp-dark-mode .news-card,
body.amp-dark-mode .search-card,
body.amp-dark-mode .widget,
body.amp-dark-mode #comments {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

/* --- 2. BASE RESET --- */
* { box-sizing: border-box; }
body { 
    font-family: var(--font-stack); 
    margin: 0; padding: 0; 
    line-height: 1.6; 
    font-size: 16px;
    background: var(--bg-body);
    color: var(--brand-dark);
    transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: var(--brand-blue); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- 3. HEADER --- */
.site-header { 
    background: var(--bg-card); 
    border-bottom: 1px solid var(--border-color); 
    padding: 15px 0; 
    position: sticky; top: 0; z-index: 1000; 
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo-text { font-size: 24px; font-weight: 700; color: var(--brand-dark); letter-spacing: -0.5px; }
.logo-text span { color: var(--brand-blue); }
.header-controls { display: flex; gap: 15px; align-items: center; }

/* Control Buttons */
.control-btn, .menu-toggle { 
    background: none; border: none; cursor: pointer; font-size: 20px; padding: 5px; 
}
.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 30px; }
.menu-toggle span { display: block; width: 100%; height: 3px; background: var(--brand-dark); border-radius: 2px; transition: 0.3s; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Desktop Menu */
.main-navigation ul { display: flex; list-style: none; gap: 25px; margin: 0; padding: 0; }
.main-navigation li a { color: var(--brand-gray); font-weight: 500; font-size: 14px; }
.main-navigation li a:hover { color: var(--brand-blue); }

/* --- 4. MOBILE MENU --- */
.mobile-menu-container {
    display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: var(--bg-body); z-index: 999; padding: 20px; overflow-y: auto;
}
.mobile-menu-container.open { display: block; }
.mobile-menu-inner ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu-inner li { border-bottom: 1px solid var(--border-color); }
.mobile-menu-inner a { display: block; padding: 15px 0; font-size: 18px; font-weight: 600; color: var(--brand-dark); }

/* --- 5. GRID & CARDS --- */
.hp-tool-grid, .news-grid, .search-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px;
}
.tool-card, .news-card, .search-card, .tool-card-simple {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; transition: 0.2s;
}
.tool-card:hover, .news-card:hover { transform: translateY(-3px); border-color: var(--brand-blue) !important; }

/* --- 6. SINGLE TOOL PAGE --- */
/* Note: Padding handled by generic layout, tool box handles its own inner spacing */
.tool-page-layout { margin-top: 40px; margin-bottom: 60px; }
.tool-breadcrumbs { font-size: 13px; color: var(--brand-gray); margin-bottom: 20px; }

/* Ad Slots */
.ad-slot-wrapper { margin-bottom: 30px; text-align: center; }
.ad-slot-wrapper.bottom-ad { margin-top: 40px; margin-bottom: 0; }
.ad-label { font-size: 10px; color: #ccc; text-transform: uppercase; display: block; margin-bottom: 5px; }

/* Related Tools Styling */
.related-tools { margin-top: 60px; border-top: 1px solid var(--border-color); padding-top: 40px; }
.related-title { font-size: 22px; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; }
.related-tool-card { display: flex; align-items: center; gap: 15px; padding: 15px; text-decoration: none; }
.related-icon { width: 50px; height: 50px; flex-shrink: 0; }
.related-info h4 { font-size: 15px; font-weight: 600; color: var(--brand-dark); margin: 0; line-height: 1.3; }
.fallback-icon { width:100%; height:100%; background: var(--bg-light); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size: 20px; }

/* Star Rating Styling */
.rating-box-wrapper {
    background: #e8f0fe; padding: 15px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #d2e3fc;
}
body.amp-dark-mode .rating-box-wrapper { background: #303134; border-color: #3c4043; }

/* --- 7. FOOTER --- */
.site-footer {
    background: var(--bg-light); border-top: 1px solid var(--border-color);
    padding: 60px 0 30px; font-size: 14px; color: var(--brand-gray);
}
body.amp-dark-mode .site-footer { background: var(--bg-card) !important; }

/* --- 8. RESPONSIVE --- */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .menu-toggle { display: flex; }
    .hp-tool-grid, .news-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}
@media (max-width: 480px) {
    .hp-tool-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   9. TOOL INTEGRATION (THEME BRIDGE)
   These rules ensure the custom tool connects with the Theme variables
   ============================================================ */

/* Main Container Bridge */
.single-tool-box {
    background-color: var(--bg-card) !important; /* Theme BG */
    border-color: var(--border-color) !important;
    color: var(--brand-dark) !important;
}

/* Text Colors */
.single-tool-box h2, .single-tool-box h3, 
.single-tool-box p, .single-tool-box label, 
.single-tool-box td, .single-tool-box strong {
    color: var(--brand-dark) !important;
}

/* Form Elements Bridge */
.single-tool-box select,
.single-tool-box input.tracker-input,
.single-tool-box .controls-area,
.single-tool-box .table-container,
.single-tool-box th {
    background-color: var(--bg-light) !important;
    border-color: var(--border-color) !important;
    color: var(--brand-dark) !important;
}

/* Result Card */
.single-tool-box .result-card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

/* Dark Mode Specific Tweaks */
body.amp-dark-mode .single-tool-box { box-shadow: none !important; }
body.amp-dark-mode .select-wrapper::after { color: var(--brand-gray) !important; }
body.amp-dark-mode .txt-red { color: #f28b82 !important; }
body.amp-dark-mode .txt-blue { color: #8ab4f8 !important; }