/**
 * Shared Layout CSS — Digital Heroes SOP Library
 * Provides the unified sidebar + light content layout used across all pages.
 * Page-specific styles (accent colors, content cards) remain inline per page.
 */

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333;
    background: #f5f7fa;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1E3A5F 0%, #0F2439 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 2000;
}

.sidebar-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.sidebar-header .emoji {
    font-size: 2em;
}

.sidebar-header h2 {
    font-size: 1em;
    margin-top: 8px;
    color: white;
}

.sidebar-back {
    display: block;
    padding: 10px 20px;
    margin: 0 15px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.sidebar-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar Navigation Grid (2x2 button layout) */
.sidebar-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 15px;
    margin-bottom: 5px;
}

.sidebar-nav-grid a {
    flex: 1 1 45%;
    text-align: center;
    margin: 0;
    padding: 8px;
    font-size: 0.8em;
    display: block;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

.sidebar-nav-grid a.nav-sop {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10B981;
}

.sidebar-nav-grid a.nav-kra {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid #8B5CF6;
}

.sidebar-nav-grid a.nav-kpi {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #F59E0B;
}

.sidebar-nav-grid a.nav-dts {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3B82F6;
}

.sidebar-nav-grid a.nav-training {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid #A855F7;
}

.sidebar-nav-grid a.nav-onboarding {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid #EC4899;
}

.sidebar-nav-grid a.nav-resources {
    background: rgba(20, 184, 166, 0.2);
    border: 1px solid #14B8A6;
}

.sidebar-nav-grid a:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Sidebar Links (anchor navigation) */
.sidebar-links {
    padding: 0 15px;
}

.sidebar-links a {
    display: block;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.sidebar-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-links a.active {
    background: rgba(139, 92, 246, 0.6);
    color: white;
}

/* Sidebar Section Title */
.sidebar-section-title {
    padding: 20px 20px 10px 20px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    margin-top: 10px;
}

/* Quick Nav (legacy support) */
.quick-nav {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-nav-title {
    font-size: 0.75em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 10px;
}

.quick-nav a {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8em;
    margin: 3px;
}

/* Print Button */
.print-btn {
    display: block;
    padding: 12px;
    margin: 15px;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-size: 0.9em;
}

.print-btn:hover {
    opacity: 0.9;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 280px;
    padding: 40px;
}

/* Header Hero */
.header {
    color: white;
    padding: 50px 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.badge-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Content Sections */
.section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.section h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #1E3A5F 0%, #0F2439 100%);
    z-index: 9999;
    padding: 0 12px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mobile-home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10B981;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .mobile-header {
        display: flex !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 9999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
    }

    .sidebar.active,
    .sidebar.open {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 70px !important;
        width: 100% !important;
    }

    .header {
        padding: 25px 20px !important;
        margin-bottom: 20px !important;
        border-radius: 0 0 15px 15px !important;
    }

    .header h1 {
        font-size: 1.5em !important;
        margin-bottom: 5px !important;
    }

    .header .subtitle {
        font-size: 0.9em !important;
        margin-bottom: 10px !important;
    }

    .badge-row {
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .badge {
        padding: 5px 12px !important;
        font-size: 0.75em !important;
    }

    .section {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }

    .section h2 {
        font-size: 1.2em !important;
    }

    .main-content {
        padding: 10px !important;
        padding-top: 70px !important;
    }
}

/* ===== PRINT ===== */
@media print {

    .sidebar,
    .mobile-header,
    .sidebar-overlay,
    .print-btn,
    .admin-floating-btn,
    .admin-banner,
    .admin-modal-overlay,
    .admin-history-panel,
    .admin-find-panel,
    .admin-toast-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
