﻿/* wwwroot/css/site.css */

/* ============================================================
   LAYOUT – MainLayout global styles (replaces CSS isolation)
   ============================================================ */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    background: #f8f6f7;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.sidebar {
    background-image: linear-gradient(180deg, #dc3545 0%, #922b21 100%) !important;
    background-color: transparent !important;
    width: 250px;
    min-width: 250px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 15px rgba(176,42,55,0.25);
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0 1rem 1rem 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}

.main-content {
    width: 100%;
    min-height: 100vh;
    background: #f8f6f7;
    margin-left: 250px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.main-content.sidebar-collapsed { margin-left: 80px; }
.main-content.sidebar-expanded  { margin-left: 250px; }

.top-row {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 0 0 1rem 1rem;
    margin: 0 0 1.5rem 0;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(192,57,43,0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-row a { color: white; text-decoration: none; }

.content {
    background: white;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    min-height: calc(100vh - 8rem);
    position: relative;
    z-index: 10;
}

@media (min-width: 769px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 1000; }
    .main-content { margin-left: 250px; width: calc(100% - 250px); }
    .main-content.sidebar-collapsed { margin-left: 80px; width: calc(100% - 80px); }
}

@media (max-width: 768px) {
    .page { flex-direction: column; }
    .sidebar {
        width: 100vw !important;
        min-width: unset !important;
        position: fixed;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
    }
    .sidebar:not(.collapsed) { transform: translateX(0); }
    .sidebar.collapsed {
        width: 80px !important;
        min-width: 80px !important;
        transform: translateX(0);
        border-radius: 0 1rem 1rem 0;
    }
    .main-content { margin-left: 0; width: 100%; }
    .main-content.sidebar-collapsed { margin-left: 80px; }
    .main-content.sidebar-expanded  { margin-left: 0; }
}

/* ============================================================
   NAV MENU – NavMenu global styles (replaces CSS isolation)
   ============================================================ */
.nav-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.nav-menu.collapsed { width: 80px; }

.nav-brand {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    justify-content: flex-start;
}

.brand-link.collapsed { justify-content: center; padding: 0.5rem 0.25rem; }
.brand-link:hover { background: rgba(255,255,255,0.1); color: white; transform: translateX(4px); }
.brand-link.collapsed:hover { transform: scale(1.05); }

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
    background: white;
    padding: 0.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-menu.collapsed .logo { margin-right: 0; width: 40px; height: 40px; }

.brand-text {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease;
    flex-grow: 1;
}

.nav-menu.collapsed .brand-text { display: none; }

.brand-title  { margin: 0; font-size: 1.1rem; font-weight: 700; color: white; white-space: nowrap; }
.brand-subtitle { color: rgba(255,255,255,0.8); font-size: 0.8rem; margin-top: 0.25rem; white-space: nowrap; }

.collapse-indicator { margin-left: auto; padding-left: 0.5rem; opacity: 0.7; transition: all 0.3s ease; }
.nav-menu.collapsed .collapse-indicator { display: none; }
.brand-link:hover .collapse-indicator { opacity: 1; transform: scale(1.1); }

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 0;
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

.nav-scrollable::-webkit-scrollbar { width: 4px; }
.nav-scrollable::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); }
.nav-scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

/* Section lists – override Bootstrap bullet */
.sidebar .nav-section {
    list-style: none !important;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.sidebar .nav-section.collapsed { margin-bottom: 0.75rem; }

.nav-section-header {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.7);
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    list-style: none !important;
}

.nav-section.collapsed .nav-section-header {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    justify-content: center;
    border-left: none;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.nav-section-header span { display: block; }
.nav-menu.collapsed .nav-section-header span { display: none; }
.nav-section-header i { font-size: 1rem; display: none; }
.nav-menu.collapsed .nav-section-header i { display: block; }

/* Nav items – override Bootstrap */
.sidebar .nav-item {
    list-style: none !important;
    margin-bottom: 0.25rem;
    position: relative;
    padding: 0;
}

/* Nav links – override Bootstrap */
.sidebar .nav-link {
    display: flex !important;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    margin: 0 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    background: none !important;
    border: none !important;
    height: auto !important;
    line-height: normal !important;
    width: auto !important;
}

.sidebar .nav-link.collapsed { padding: 0.75rem; justify-content: center; margin: 0 0.75rem; }

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.15) !important;
    color: white !important;
    transform: translateX(8px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

.sidebar .nav-link.collapsed:hover { transform: scale(1.1); }

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.25) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #ff8a80;
    border-radius: 2px;
}

.sidebar .nav-link.collapsed.active::before {
    left: 50%;
    top: -0.25rem;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar .nav-link.collapsed i { margin-right: 0; font-size: 1.25rem; }

.nav-text { transition: all 0.3s ease; flex: 1; overflow: hidden; }
.nav-menu.collapsed .nav-text { display: none; }

/* Tooltip for collapsed state */
.nav-menu.collapsed .sidebar .nav-link { position: relative; }

.nav-menu.collapsed .sidebar .nav-link:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #212529;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.2);
}

/* Focus accessibility */
.sidebar .nav-link:focus,
.brand-link:focus {
    outline: 2px solid #20c997;
    outline-offset: 2px;
}

/* ── Quick Search ── */
.nav-search {
    padding: 0.5rem 0.75rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-search-box:focus-within {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.45);
}

.nav-search-icon {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.nav-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.85rem;
    width: 100%;
    min-width: 0;
}

.nav-search-input::placeholder { color: rgba(255,255,255,0.45); }

.nav-search-clear {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nav-search-clear:hover { color: white; }

/* ── Section controls (Expand All / Collapse All) ── */
.nav-section-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-ctrl-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.375rem;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 0.18rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.nav-ctrl-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.nav-ctrl-btn i { font-size: 0.75rem; }

/* ── Collapsible section headers ── */
.nav-section-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-section-toggle:hover {
    background: rgba(255,255,255,0.15) !important;
    color: rgba(255,255,255,1) !important;
}

.section-chevron {
    margin-left: auto !important;
    font-size: 0.72rem !important;
    width: auto !important;
    display: block !important;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-section-toggle:hover .section-chevron { opacity: 1; }

.nav-section-toggle.section-closed .section-chevron {
    transform: rotate(-90deg);
}

.nav-menu.collapsed .section-chevron { display: none !important; }

/* ============================================================ */

.rundown-compact .card-header,
.rundown-compact .card-body {
    padding: 0.75rem 1rem;
}

.rundown-compact table {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.rundown-compact th, .rundown-compact td {
    padding: 0.35rem 0.5rem;
}

.rundown-compact h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.rundown-compact .card-header h3 {
    font-size: 1.1rem;
}

/* Tambahan: Override warna navbar utama ke merah */
.navbar.bg-primary, .navbar.bg-primary, .navbar.navbar-dark.bg-primary {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Jika ada elemen dengan .navbar-brand, pastikan tetap kontras */
.navbar .navbar-brand, .navbar .navbar-nav .nav-link {
    color: #fff !important;
}

/* Dropdown menu tetap readable */
.navbar .dropdown-menu {
    background-color: #fff;
}

/* Aktifkan warna merah untuk border bawah nav jika ada */
.navbar {
    border-bottom: 3px solid #dc3545 !important;
}
