/* =================================
   NAVBAR MODERNO - CLIENTE PORTAL
   ================================= */

/* Variáveis CSS - Tema Light (padrão) */
:root {
    --navbar-bg: #ffffff;
    --navbar-height: 64px;
    --navbar-text: #1f2937;
    --navbar-text-muted: #6b7280;
    --navbar-hover: #f3f4f6;
    --navbar-border: #e5e7eb;
    --brand-color: #6366f1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Variáveis para temas globais - Cliente (roxo) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --content-bg: #f9fafb;
}

/* Tema Dark */
.dark-theme {
    --navbar-bg: #0f172a;
    --navbar-text: #f8fafc;
    --navbar-text-muted: #cbd5e0;
    --navbar-hover: #1e293b;
    --navbar-border: #334155;

    /* Variáveis para temas globais - cores mais claras para melhor contraste */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --border-color: #374151;
    --card-bg: #1f2937;
    --input-bg: #374151;
    --sidebar-bg: #111827;
    --content-bg: #0f172a;
}

/* Tema Light (explícito) */
.light-theme {
    --navbar-bg: #ffffff;
    --navbar-text: #1f2937;
    --navbar-text-muted: #6b7280;
    --navbar-hover: #f3f4f6;
    --navbar-border: #e5e7eb;

    /* Variáveis para temas globais */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --content-bg: #f9fafb;
}

/* Reset e base */
.modern-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: var(--shadow);
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
}

/* Seção Esquerda */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--navbar-text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 20px;
}

.sidebar-toggle:hover {
    background: var(--navbar-hover);
    color: var(--navbar-text);
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--navbar-text);
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition);
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--navbar-text);
    text-decoration: none;
}

.brand-logo {
    height: 36px;
    width: auto;
    transition: filter 0.3s ease;
}

/* Logo original no modo light */
.light-theme .brand-logo {
    filter: none;
}

/* Logo branca no modo dark */
.dark-theme .brand-logo {
    filter: brightness(0) invert(1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 16px;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--navbar-text-muted);
    font-weight: 400;
}

/* Seção Direita */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--navbar-text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 18px;
}

.navbar-link:hover,
.navbar-link:focus {
    background: var(--navbar-hover);
    color: var(--navbar-text);
    text-decoration: none;
}

/* Botão de Toggle do Tema */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--navbar-text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
    padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--navbar-hover);
    color: var(--navbar-text);
    outline: none;
}

.theme-toggle .material-icons {
    font-size: 20px;
    transition: var(--transition);
}

/* Botão de tema mobile */
.theme-toggle-mobile {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    width: 100% !important;
    text-align: left !important;
}

.theme-toggle-mobile:hover {
    background: var(--navbar-hover) !important;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-toggle:hover {
    background: var(--navbar-hover);
}

.mobile-toggle .material-icons {
    font-size: 20px;
    color: var(--navbar-text-muted);
    transition: var(--transition);
}

.mobile-toggle:hover .material-icons {
    color: var(--navbar-text);
}

/* Mobile Menu */
.mobile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: var(--navbar-bg);
    border: 1px solid var(--navbar-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    margin: 8px 24px 0 0;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--navbar-text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--navbar-border);
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-menu-item:hover {
    background: var(--navbar-hover);
    color: var(--navbar-text);
    text-decoration: none;
}

.mobile-menu-item .material-icons {
    font-size: 18px;
}

.mobile-menu-item span {
    font-size: 14px;
    font-weight: 500;
}

/* License Badge */
.license-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.license-badge.urgent {
    background: #ef4444;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsivo */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 16px;
    }

    .brand-text {
        display: none;
    }

    .navbar-menu {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-menu {
        width: 240px;
        margin: 8px 16px 0 0;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        height: 28px;
    }

    .navbar-brand {
        font-size: 16px;
    }

    .mobile-menu {
        width: calc(100vw - 32px);
        right: 16px;
        margin: 8px 0 0 0;
    }
}

/* Estados de focus para acessibilidade */
.sidebar-toggle:focus,
.navbar-link:focus,
.mobile-toggle:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}