/*
============================================================
VideoAnalyzer 3.1
Arquivo: wwwroot/css/site.css

Layout visual:
- Menu lateral Espaço Sistemas
- Logo institucional
- Cabeçalho do VideoAnalyzer
- Data e hora
- Identificação do administrador
- Área de conteúdo
- Rodapé
- Responsividade

============================================================
*/
/* =========================================================
   VARIÁVEIS
========================================================= */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #94a3b8;
    --page-bg: #f5f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --sidebar-width: 260px;
}

/* =========================================================
   CONFIGURAÇÕES GERAIS
========================================================= */

html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

/* =========================================================
   ESTRUTURA PRINCIPAL
========================================================= */

.app-container {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow: hidden;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.main-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

/* =========================================================
   IDENTIDADE ESPAÇO SISTEMAS
========================================================= */

.sidebar-brand {
    height: 105px;
    min-height: 105px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    overflow: hidden;
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}

.brand-logo-image {
    display: block;
    width: 185px;
    height: 65px;
    max-width: 100%;
    max-height: 65px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}

/* =========================================================
   MENU LATERAL
========================================================= */

.sidebar-nav {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* TÍTULOS DAS SEÇÕES */

.menu-section-title {
    color: #7f8da3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 15px 12px 10px;
}

/* LINKS */

.sidebar-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 14px;
    margin-bottom: 5px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

    .sidebar-link i {
        width: 20px;
        min-width: 20px;
        text-align: center;
        font-size: 16px;
    }

    .sidebar-link:hover {
        background: var(--sidebar-hover);
        color: #ffffff;
    }

    .sidebar-link.active {
        background: var(--primary);
        color: #ffffff;
    }

    /* LINKS TEMPORARIAMENTE DESATIVADOS */

    .sidebar-link[aria-disabled="true"] {
        opacity: 0.78;
        cursor: default;
    }

        .sidebar-link[aria-disabled="true"]:hover {
            background: transparent;
            color: var(--sidebar-text);
        }

/* =========================================================
   RODAPÉ DO MENU
========================================================= */

.sidebar-footer {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--sidebar-muted);
    font-size: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: #f59e0b;
    border-radius: 50%;
}

/* =========================================================
   CABEÇALHO SUPERIOR - FUNDO AZUL
========================================================= */

.topbar {
    height: 88px;
    min-height: 88px;
    width: 100%;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #b5b2fe;
    border-bottom: 1px solid #d5e3f7;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    flex-shrink: 0;
}

/* =========================================================
   BOTÃO DO MENU
========================================================= */

.sidebar-toggle {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    padding: 5px;
    cursor: pointer;
}

    .sidebar-toggle:hover {
        color: var(--primary);
    }

/* =========================================================
   ÍCONE DO VIDEOANALYZER
========================================================= */

.system-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2ff;
    color: var(--primary);
    border-radius: 11px;
    font-size: 23px;
    flex-shrink: 0;
}

/* =========================================================
   IDENTIFICAÇÃO DO SISTEMA
========================================================= */

.system-identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.system-title {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

    .system-title strong {
        color: #172033;
        font-size: 20px;
        font-weight: 700;
    }

.system-divider {
    color: #cbd5e1;
    font-size: 20px;
}

.system-description {
    color: #64748b;
    font-size: 13px;
}

.system-identity small {
    color: #64748b;
    font-size: 11px;
}

/* =========================================================
   DATA E HORA
========================================================= */

.datetime-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

    .datetime-display i {
        color: #94a3b8;
        font-size: 16px;
    }

/* =========================================================
   NOTIFICAÇÕES
========================================================= */

.notification-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 17px;
    flex-shrink: 0;
}

/* =========================================================
   ADMINISTRADOR
========================================================= */

.user-display {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    flex-shrink: 0;
}

    .user-display > i {
        font-size: 25px;
        color: #94a3b8;
    }

.user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .user-info strong {
        color: #374151;
        font-size: 11px;
        font-weight: 600;
    }

    .user-info small {
        color: #94a3b8;
        font-size: 10px;
    }

/* =========================================================
   CONTEÚDO PRINCIPAL
========================================================= */

.main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 30px;
    background: var(--page-bg);
}

/* =========================================================
   RODAPÉ DA APLICAÇÃO
========================================================= */

.app-footer {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 30px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

/* =========================================================
   ELEMENTOS GERAIS
========================================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

    .btn-primary:hover {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.2);
}

/* =========================================================
   MENU RECOLHIDO - DESKTOP
========================================================= */

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
}

/* =========================================================
   SOBREPOSIÇÃO MOBILE
========================================================= */

.sidebar-overlay {
    display: none;
}

/* =========================================================
   RESPONSIVIDADE - TABLETS
========================================================= */

@media (max-width: 1100px) {

    .topbar {
        padding: 0 18px;
    }

    .topbar-right {
        gap: 12px;
    }

    .system-description {
        display: none;
    }
}

/* =========================================================
   RESPONSIVIDADE - CELULARES
========================================================= */

@media (max-width: 767.98px) {

    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar-brand {
        height: 90px;
        min-height: 90px;
        padding: 12px 15px;
    }

    .brand-logo-image {
        width: 170px;
        height: 58px;
        max-height: 58px;
    }

    .main-wrapper {
        margin-left: 0;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1030;
    }

    body.mobile-menu-open .sidebar-overlay {
        display: block;
    }

    .topbar {
        height: 70px;
        min-height: 70px;
        padding: 0 12px;
        gap: 8px;
    }

    .topbar-left {
        gap: 8px;
    }

    .topbar-right {
        gap: 8px;
    }

    .system-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 18px;
    }

    .system-title strong {
        font-size: 16px;
    }

    .system-divider,
    .system-description,
    .system-identity small,
    .datetime-display,
    .user-info {
        display: none;
    }

    .main-content {
        padding: 18px 14px;
    }

    .app-footer {
        padding: 12px 14px;
        font-size: 10px;
    }
}

/* =========================================================
   TELAS MUITO ESTREITAS
========================================================= */

@media (max-width: 380px) {

    :root {
        --sidebar-width: 245px;
    }

    .system-title strong {
        font-size: 14px;
    }

    .notification-icon {
        display: none;
    }
}
