/* =========================================
   THE OPEN TOOLS - MASTER STYLESHEET
   Brand Identity: Brand Reflex
   Status: FIXED (Responsive + Sidebar Visibility)
   ========================================= */

:root {
    /* --- COLOR PALETTE --- */
    --bg-body:        #202025;
    --bg-header:      #3D3A4F;
    --card-bg:        #2b2b33;
    
    --accent-gold:    #FFC94C;
    --accent-dark:    #D49D3A;
    
    --text-main:      #ffffff;
    --text-muted:     #9ca3af;
    --border-color:   #4b4b52;

    /* --- LAYOUT --- */
    --container-width: 1200px;
    --header-height:   70px;
    --radius-md:       8px;
    --radius-lg:       12px;
}

/* --- RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* --- UTILITIES --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.gold-text { color: var(--accent-gold); }
.btn-primary {
    background-color: var(--accent-gold);
    color: #202025;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: inline-block;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

/* =========================================
   1. HEADER
   ========================================= */
header {
    background-color: var(--bg-header);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border-bottom: 2px solid #2a2836;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 30px; }
.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: #e0e0e0;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-gold); }
.nav-links a.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent-gold);
    position: absolute;
    bottom: -24px;
}

/* =========================================
   2. HOMEPAGE
   ========================================= */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: radial-gradient(circle at center, #2e2e36 0%, var(--bg-body) 70%);
}
.hero h1 { font-size: 3rem; margin-bottom: 15px; }
.hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }

.search-box { position: relative; max-width: 500px; margin: 0 auto; }
.search-box input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-header);
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: 0.3s;
}
.search-box input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 201, 76, 0.2);
}

.section-title {
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
}

.tool-card {
    background-color: var(--bg-header);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: 0.3s;
    cursor: pointer;
    position: relative;
}
.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.tool-icon { font-size: 2rem; margin-bottom: 15px; display: block; }
.badge {
    position: absolute;
    top: 15px; right: 15px;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* =========================================
   3. TOOL PAGE LAYOUT (CRITICAL FOR SIDEBAR)
   ========================================= */
.breadcrumbs { padding: 20px 0; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--accent-gold); }

.tool-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 120px;
    align-items: flex-start;
}

.tool-main { flex: 3; max-width: 100%; } /* Added max-width to prevent pushing */
.tool-sidebar { flex: 1; min-width: 280px; } /* Slightly reduced min-width to fit better */

/* Workspace */
.tool-workspace {
    background-color: var(--bg-header);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.workspace-header { margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }

/* Inputs */
textarea, .tool-input {
    width: 100%;
    background-color: #2b2b33;
    border: 1px solid var(--border-color);
    color: white;
    padding: 15px;
    border-radius: var(--radius-md);
    font-family: monospace;
    margin-bottom: 15px;
    resize: vertical;
}
textarea:focus, .tool-input:focus { border-color: var(--accent-gold); outline: none; }

/* Content */
.tool-content {
    background-color: var(--bg-header);
    padding: 40px;
    border-radius: var(--radius-lg);
    line-height: 1.8;
}
.tool-content h2 { color: var(--accent-gold); margin-top: 30px; margin-bottom: 15px; }
.tool-content h3 { color: white; margin-top: 25px; margin-bottom: 10px; }
.tool-content p { margin-bottom: 20px; color: #d1d5db; }
.tool-content ul { padding-left: 20px; margin-bottom: 20px; color: #d1d5db; }
.tool-content li { margin-bottom: 10px; list-style-type: disc; }

/* =========================================
   4. SIDEBAR WIDGETS
   ========================================= */
.sidebar-widget {
    background-color: var(--bg-header);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sidebar-widget h4 {
    margin-bottom: 20px;
    color: var(--accent-gold);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #4b4b52;
    padding-bottom: 10px;
}

.sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #2b2b33; 
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: #33333d;
    border-color: var(--accent-gold);
    color: white;
    transform: translateX(5px);
    padding-left: 20px;
}

.sidebar-link::after {
    content: '→'; 
    color: var(--accent-gold);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}
.sidebar-link:hover::after { opacity: 1; }

/* SIDEBAR AD CONTAINER (Fixed for Overlapping) */
#ad-sidebar-slot {
    background-color: var(--bg-header);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    
    /* Alignment */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    
    /* Safety */
    width: 100%;
    box-sizing: border-box;
}

/* =========================================
   5. FOOTER & MOBILE RESPONSIVENESS
   ========================================= */
footer {
    background-color: #1a1a20;
    padding: 40px 0;
    border-top: 1px solid #333;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
}
footer a { color: var(--accent-gold); }

.mobile-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

/* Mobile Logic */
@media (max-width: 900px) {
    .tool-layout { flex-direction: column; }
    .tool-sidebar { order: 2; width: 100%; min-width: 0; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; color: var(--accent-gold); }
    
    /* Category Descriptions */
.category-desc {
    max-width: 800px;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}
}

/* =========================================
   7. HOMEPAGE CATEGORY FIXES
   ========================================= */

/* Wraps each category to add vertical space */
.home-category {
    margin-bottom: 80px; /* Big gap between categories */
    border-bottom: 1px solid #333; /* Subtle divider line */
    padding-bottom: 60px;
}

/* Remove border from the last category */
.home-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Constrain the description text so it doesn't stretch too wide */
.category-desc {
    max-width: 700px;       /* easier to read width */
    margin-bottom: 40px;    /* Space before the grid */
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Ensure the section titles align with the grid */
.section-title h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* --- TEMPORARY: Hide Software Reviews Menu --- */
/* This hides the link in the header on All pages */
.nav-links a[href*="reviews"] {
    display: none !important;
}