/*
Theme Name: Software Guide App
Theme URI: https://example.com/software-guide
Author: AI Guide Builder
Description: A documentation theme with a mobile-app feel and Premium Black styling.
Version: 16.0 (Silver Gradient)
*/

/* --- 1. CSS VARIABLES --- */
:root {
    /* PREMIUM BLACK PALETTE */
    --primary-color: #111111;      /* Premium Black */
    --primary-dark: #000000;       /* Pure Black */
    --primary-light: #f9fafb;      /* Off-white */
    
    --active-main: #000000;        /* Active Menu Text */
    --active-icon: #000000;        /* Active Icons */
    --inactive-text: #64748b;      /* Slate Grey (Text only) */
    
    --sidebar-width: 280px;
    --header-height: 64px;
    --bg-color: #ffffff;
    --text-color: #334155;         /* Dark Grey Text */
    --sidebar-bg: #ffffff;         /* Clean White Sidebar */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- 2. RESET & BASE --- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    overflow: hidden; 
    height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* --- 3. APP LAYOUT STRUCTURE --- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Mobile Header */
.mobile-header {
    display: none;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

#mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: -8px; 
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.mobile-logo-container img { height: 32px; width: auto; object-fit: contain; }

/* --- 4. SIDEBAR NAVIGATION --- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 60;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header a { font-weight: 800; font-size: 1.2rem; color: var(--primary-dark); }
.sidebar-header img { max-height: 40px; width: auto; }

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    -webkit-overflow-scrolling: touch;
}

/* --- MAIN MENU ITEMS --- */
.menu-item-main {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--inactive-text); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.menu-item-main:hover {
    background: #f8fafc; /* Very light grey */
    color: var(--primary-dark);
}

/* Active Main Menu */
.menu-item-main.active {
    color: var(--active-main); 
    background-color: transparent; 
}

.menu-label { display: flex; align-items: center; gap: 12px; }

/* ICON STYLING */
.menu-icon { 
    width: 20px; 
    height: 20px; 
    opacity: 0.6; 
    color: var(--primary-color); 
    transition: all 0.3s ease;
}

/* Active Icon Color */
.menu-item-main.active .menu-icon { 
    opacity: 1; 
    color: var(--active-icon); 
    filter: drop-shadow(0 2px 4px rgba(0,0,0, 0.15));
    transform: scale(1.05); 
}

.menu-chevron { width: 16px; height: 16px; transition: transform 0.2s; opacity: 0.4; }
.menu-item-main.active .menu-chevron { transform: rotate(90deg); opacity: 1; }


/* --- TIMELINE SUB MENU STYLING --- */

.sub-menu-container {
    display: none;
    position: relative;
    padding: 4px 0 8px 0;
}
.sub-menu-container.open { display: block; }

/* The Vertical Line */
.sub-menu-container::before {
    content: '';
    position: absolute;
    top: 0; bottom: 15px;
    left: 33px; 
    width: 2px;
    background-color: #e2e8f0;
    z-index: 1;
}

.menu-item-sub {
    display: flex;
    align-items: center;
    padding: 10px 24px 10px 52px;
    font-size: 0.9rem;
    color: var(--inactive-text); 
    transition: all 0.2s;
    position: relative;
    line-height: 1.3;
}

/* The Timeline Dot */
.menu-item-sub::before {
    content: '';
    position: absolute;
    left: 29px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #cbd5e1; 
    z-index: 2;
    transition: all 0.2s;
}

.menu-item-sub:hover { color: var(--primary-dark); }
.menu-item-sub:hover::before { border-color: var(--primary-color); transform: translateY(-50%) scale(1.1); }

/* --- ACTIVE SUB MENU (PREMIUM BLACK) --- */
.menu-item-sub.current-page {
    color: var(--active-icon); 
    font-weight: 700;
}

/* The Active Dot */
.menu-item-sub.current-page::before {
    background-color: var(--active-icon);
    border-color: var(--active-icon);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); 
}

/* Hide legacy line */
.sub-line { display: none; }


/* --- 5. CONTENT AREA --- */
.app-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 40px;
    /* PREMIUM SILVER GRADIENT ADDED HERE */
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    scroll-behavior: smooth;
    position: relative;
}

.content-wrapper { max-width: 800px; margin: 0 auto; }
h1.page-title { font-size: 2.2rem; margin-bottom: 30px; color: #000; line-height: 1.2; font-weight: 800; }

/* Typography */
.entry-content { line-height: 1.7; color: #334155; font-size: 1.05rem; }
.entry-content p { margin-bottom: 1.5em; }
.entry-content img { max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-md); }

/* Videos */
.entry-content video, .entry-content iframe, .wp-block-embed__wrapper iframe { 
    width: 100% !important; 
    border-radius: 12px; 
    margin: 20px 0; 
    aspect-ratio: 16/9; 
    border: none;
    box-shadow: var(--shadow-md);
}

/* Note Block (Monochrome) */
.guide-note {
    padding: 20px;
    border-left: 4px solid #000;
    background-color: #f9fafb; 
    border-radius: 4px;
    margin: 24px 0;
    font-weight: 500;
    color: #111;
}

/* --- 6. MOBILE RESPONSIVE --- */
.mobile-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 55;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}
.mobile-overlay.is-visible { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .app-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 80%; max-width: 300px;
        transform: translateX(-100%);
        box-shadow: none; border-right: none;
    }
    .app-sidebar.is-open { transform: translateX(0); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
    .app-content { padding: 24px 20px; padding-top: 88px; }
}