/* public/css/layout.css */
/* ETEO NEXUS - LAYOUT ENGINE */

body { 
    margin: 0; 
    font-family: var(--font-main); 
    overflow: hidden; 
    /* Background Global Deep Space */
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
    color: var(--text-primary);
}

.app-container { 
    display: flex; 
    height: 100vh; 
    width: 100vw; 
    position: relative;
}

/* =========================================
   SIDEBAR 2.0 - FLOATING GLASS DOCK
   ========================================= */

.sidebar {
    /* Flutuante e Desacoplado */
    width: 260px;
    margin: 20px 20px 20px 20px; /* Margem em todos os lados */
    height: calc(100vh - 40px); /* Altura total menos margens */
    
    /* Vidro Tecnológico */
    background: rgba(13, 18, 30, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 20px 20px 50px rgba(0,0,0,0.5);
    
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Impede que o flexbox esmague o menu */
}

/* Marca ETEO NEXUS */
.brand-header {
    padding: 30px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo-icon-wrapper {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.brand-text h2 {
    font-size: 1.2rem; color: #fff; margin: 0; font-weight: 800; letter-spacing: -0.5px;
    line-height: 1;
}
.brand-text h2 span { color: var(--primary); }
.brand-text small { font-size: 0.65rem; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; display: block; margin-top: 4px; }


/* Menu de Navegação */
.nav-menu {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex; flex-direction: column; gap: 8px;
}

/* Scrollbar fina para o menu */
.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* Etiquetas de Seção */
.nav-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    margin: 30px 20px 10px 20px; /* Espaçamento */
    
    /* REMOÇÃO DO RETÂNGULO (Blindada) */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    
    opacity: 0.7;
}

/* O Item de Menu (Botão) */
.nav-item {
    position: relative;
    background: transparent;
    border: none;
    width: 100%;
    display: flex; align-items: center; gap: 15px;
    padding: 14px 18px;
    border-radius: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-item .material-icons-round { font-size: 22px; transition: color 0.3s; }
.nav-link-text { font-size: 0.9rem; font-weight: 600; white-space: nowrap; opacity: 1; transition: opacity 0.3s; }

/* Estado: Hover */
.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: #fff;
}
.nav-item:hover .material-icons-round { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* Estado: Ativo (Glow Lateral) */
.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
    color: #fff;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 15%; bottom: 15%; width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 4px 0 15px var(--primary);
}
.nav-item.active .material-icons-round { color: var(--primary); }

/* Badge de Notificação (Ponto Vermelho) */
.badge-dot {
    position: absolute; top: -2px; right: -2px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--danger);
    display: none; /* JS ativa */
}


/* Footer (Perfil e Logout) */
.sidebar-footer {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    display: flex; flex-direction: column; gap: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-mini-profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; background: linear-gradient(45deg, var(--primary), var(--accent)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; font-size: 0.8rem; }

.user-details { overflow: hidden; }
.user-details strong { display: block; color: white; font-size: 0.9rem; white-space: nowrap; }
.user-details small { color: var(--text-secondary); font-size: 0.75rem; }

.footer-actions { display: flex; justify-content: space-between; gap: 10px; }
.btn-icon-footer {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.btn-icon-footer:hover { background: rgba(255,255,255,0.1); color: white; }


/* --- MODO COLAPSADO (Tablet) --- */
.sidebar.collapsed { width: 88px; }
.sidebar.collapsed .brand-text, 
.sidebar.collapsed .nav-link-text, 
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-details { 
    opacity: 0; pointer-events: none; display: none; 
}
.sidebar.collapsed .brand-header { justify-content: center; padding: 30px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 14px 0; }
.sidebar.collapsed .user-mini-profile { justify-content: center; }
.sidebar.collapsed .footer-actions { flex-direction: column; }


/* =========================================
   MAIN CONTENT (Ajustado para Sidebar Flutuante)
   ========================================= */

.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative;
    /* Remove padding excessivo se houver */
}

.view-container { 
    flex: 1; 
    padding: 0; /* Dashboard já tem seu padding interno */
    overflow-y: auto; 
}

/* Scroll global do conteúdo (app-view) */
.view-container::-webkit-scrollbar {
    width: 10px;
}
.view-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}
.view-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, #1e293b 100%);
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.2);
}
.view-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255,255,255,0.03);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Page Title – glass + neon accent */
#page-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(59,130,246,0.12), rgba(168,85,247,0.10));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 10px 40px rgba(0,0,0,0.35),
        0 0 18px rgba(59,130,246,0.35),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    text-transform: none;
    position: relative;
}

#page-title::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12), transparent 45%);
    pointer-events: none;
}

#page-title .material-icons-round {
    font-size: 20px;
    color: var(--primary);
    text-shadow: 0 0 12px rgba(59,130,246,0.7);
}

.btn-ghost.icon-only {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 6px;
    border-radius: 10px;
    display: none; /* só aparece em telas menores */
}

.btn-ghost.icon-only:hover {
    background: rgba(255,255,255,0.08);
}

@media (max-width: 1024px) {
    .btn-ghost.icon-only {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        margin: 10px;
        height: calc(100vh - 20px);
        transform: translateX(0);
        transition: transform 0.3s ease, width 0.3s ease;
        width: 240px;
        z-index: 2000;
    }

    .sidebar.collapsed {
        transform: translateX(-110%);
        width: 240px;
    }

    .main-content {
        padding-left: 0;
    }
}

/* =========================================
   MÓDULO CÂMERA (Mantido e Polido)
   ========================================= */
.camera-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 50px auto; /* Mais margem superior */
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    aspect-ratio: 3/4;
    border: 1px solid var(--border);
}

#cam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.1s;
}

.camera-guide {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: var(--primary);
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0.8;
}

.camera-controls {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 20;
    padding: 0 20px;
    box-sizing: border-box;
}

.btn-shutter {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 4px solid white;
    cursor: pointer;
    transition: transform 0.1s;
    backdrop-filter: blur(5px);
}
.btn-shutter:active { transform: scale(0.9); background: white; }

.btn-secondary-action {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-secondary-action span { font-size: 24px; }
