/* CCB Barueri Admin - Custom Styles */

/* Botão fechar melhorado — substitui o btn-close padrão do Bootstrap */
.btn-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: #343a40;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn-x:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
.btn-x:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.3);
}

/* Dynamic Module Loading Styles */
#dashboard-content, #module-content {
    transition: opacity 0.3s ease-in-out;
}

.module-loading {
    opacity: 0.6;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.35rem;
}

/* Back Button Styles */
.btn-back {
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Table Action Buttons */
.btn-group .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
}

.btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* User Avatar Icons */
.icon-circle {
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 0.35rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
}

/* Status badges */
.badge {
    font-size: 0.75em;
}

/* CCB Logo Styles */

/* Opção 1: Logo com CSS puro */
.ccb-logo {
    position: relative;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(45, 156, 219, 0.3);
    transition: all 0.3s ease;
}

.ccb-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 156, 219, 0.4);
}

.ccb-logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #2D9CDB, #1A7CC5, #60C2F0);
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ccb-logo:hover::before {
    opacity: 1;
}

/* Opção 2: Logo hexagonal moderno */
.ccb-logo-hex {
    position: relative;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.ccb-logo-hex:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

/* Opção 3: Logo com efeito glassmorphism */
.ccb-logo-glass {
    position: relative;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(45, 156, 219, 0.2);
    transition: all 0.3s ease;
}

.ccb-logo-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(45, 156, 219, 0.3), rgba(118, 75, 162, 0.3));
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ccb-logo-glass:hover::before {
    opacity: 1;
}

.ccb-logo-glass:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(45, 156, 219, 0.3);
}

/* Estilos de texto */
.ccb-text {
    margin-left: 12px;
}

.ccb-title {
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #2D9CDB 0%, #1A7CC5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -0.5px;
}

.ccb-subtitle {
    font-size: 0.65rem;
    color: #a8b1d8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Opção 5: Logo Tipográfico (ATIVO) */
.ccb-logo-typography {
    text-align: center;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.ccb-logo-typography:hover {
    transform: scale(1.02) translateY(-1px);
}

.ccb-brand-main {
    font-weight: 900;
    font-size: 1.7rem;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -1px;
    font-family: 'Nunito', sans-serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ccb-brand-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    letter-spacing: 3px;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-family: 'Nunito', sans-serif;
}

/* Hover effect suave para o logo tipográfico */
.sidebar-brand:hover .ccb-brand-main {
    text-shadow: 0 2px 8px rgba(255,255,255,0.4);
}

.sidebar-brand:hover .ccb-brand-sub {
    color: rgba(255,255,255,1);
    letter-spacing: 4px;
}

/* Responsivo para logo tipográfico */
@media (max-width: 768px) {
    .ccb-brand-main {
        font-size: 1.4rem;
    }
    
    .ccb-brand-sub {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }
}

/* Animações personalizadas */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ccb-logo {
    animation: float 3s ease-in-out infinite;
}

.ccb-logo-hex {
    animation: pulse 2s ease-in-out infinite;
}

/* Sidebar customizations */
.sidebar-brand:hover .ccb-logo,
.sidebar-brand:hover .ccb-logo-hex,
.sidebar-brand:hover .ccb-logo-glass {
    animation-play-state: paused;
}

/* Responsivo */
@media (max-width: 768px) {
    .ccb-logo,
    .ccb-logo-hex,
    .ccb-logo-glass {
        width: 35px;
        height: 35px;
    }
    
    .ccb-title,
    .ccb-title-glass {
        font-size: 1rem;
    }
    
    .ccb-subtitle,
    .ccb-subtitle-glass {
        font-size: 0.6rem;
    }
}

/* ================================================================
   CCB THEME — Light Blue Override
   Sobrescreve sb-admin-2.min.css para unificar a paleta de azul claro.
   Primary : #2D9CDB  |  Dark : #1A7CC5  |  Darker : #1570C4
   ================================================================ */

/* Sidebar */
.bg-gradient-primary {
    background-color: #2D9CDB !important;
    background-image: linear-gradient(180deg, #2D9CDB 10%, #1570C4 100%) !important;
}

/* Botões primários */
.btn-primary {
    background-color: #2D9CDB !important;
    border-color: #2D9CDB !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active,
.show > .btn-primary.dropdown-toggle {
    background-color: #1A7CC5 !important;
    border-color: #1A7CC5 !important;
}
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active:focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 156, 219, 0.35) !important;
}
.btn-primary.disabled,
.btn-primary:disabled {
    background-color: #2D9CDB !important;
    border-color: #2D9CDB !important;
}

/* Outline primário */
.btn-outline-primary {
    color: #2D9CDB !important;
    border-color: #2D9CDB !important;
}
.btn-outline-primary:hover {
    background-color: #2D9CDB !important;
    border-color: #2D9CDB !important;
    color: #fff !important;
}

/* Cor de texto e links */
a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
    color: #2D9CDB;
}
a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):hover {
    color: #1A7CC5;
}
.text-primary { color: #2D9CDB !important; }

/* Fundo primário */
.bg-primary { background-color: #2D9CDB !important; }

/* Bordas */
.border-left-primary { border-left-color: #2D9CDB !important; }
.border-primary { border-color: #2D9CDB !important; }

/* Badges */
.badge-primary { background-color: #2D9CDB !important; }

/* Formulários — foco */
.form-control:focus {
    border-color: #2D9CDB !important;
    box-shadow: 0 0 0 0.2rem rgba(45, 156, 219, 0.25) !important;
}

/* Paginação */
.page-item.active .page-link {
    background-color: #2D9CDB !important;
    border-color: #2D9CDB !important;
}
.page-link { color: #2D9CDB !important; }
.page-link:hover { color: #1A7CC5 !important; }

/* Progress bars */
.progress-bar { background-color: #2D9CDB !important; }

/* Gradiente bg-gradient-primary aplicado também ao nav e header */
.bg-gradient-primary .nav-item .nav-link { color: rgba(255,255,255,0.8); }
.bg-gradient-primary .nav-item .nav-link:hover,
.bg-gradient-primary .nav-item.active .nav-link { color: #fff; }

/* ----------------------------------------------------------------
   Botões de ação dos módulos — paleta azul unificada
   Escopo: apenas elementos com .btn (não afeta .badge-success etc.)
   ---------------------------------------------------------------- */

/* btn-success → azul primário (ações principais: Novo, Importar…) */
.btn.btn-success {
    background-color: #2D9CDB !important;
    border-color: #2D9CDB !important;
    color: #fff !important;
}
.btn.btn-success:hover,
.btn.btn-success:focus,
.btn.btn-success:active,
.btn.btn-success:not(:disabled):not(.disabled):active {
    background-color: #1A7CC5 !important;
    border-color: #1A7CC5 !important;
}
.btn.btn-success:focus, .btn.btn-success.focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 156, 219, 0.35) !important;
}

/* btn-info → azul médio (ações secundárias: Exportar, Inventário…) */
.btn.btn-info {
    background-color: #1A7CC5 !important;
    border-color: #1A7CC5 !important;
    color: #fff !important;
}
.btn.btn-info:hover,
.btn.btn-info:focus,
.btn.btn-info:active,
.btn.btn-info:not(:disabled):not(.disabled):active {
    background-color: #1570C4 !important;
    border-color: #1570C4 !important;
}
.btn.btn-info:focus, .btn.btn-info.focus {
    box-shadow: 0 0 0 0.2rem rgba(26, 124, 197, 0.35) !important;
}

/* outline variants */
.btn.btn-outline-success {
    color: #2D9CDB !important;
    border-color: #2D9CDB !important;
}
.btn.btn-outline-success:hover {
    background-color: #2D9CDB !important;
    color: #fff !important;
}
.btn.btn-outline-info {
    color: #1A7CC5 !important;
    border-color: #1A7CC5 !important;
}
.btn.btn-outline-info:hover {
    background-color: #1A7CC5 !important;
    color: #fff !important;
}

/* ================================================================ */

/* ================================================================
   Sidebar — Itens de Menu Bloqueados (sem permissão)
   ================================================================ */
.nav-item-locked .nav-link {
    opacity: 0.45;
    cursor: not-allowed !important;
}

.nav-item-locked .nav-link:hover {
    color: rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
    opacity: 0.55;
}

.nav-lock-icon {
    font-size: 0.6rem;
    vertical-align: middle;
    margin-left: 5px;
    opacity: 0.8;
}

/* Tooltip customizado para itens bloqueados — Bootstrap tooltip via JS */
/* ================================================================ */

/* Chart Container Styles */
.chart-container {
    position: relative;
    margin-bottom: 1rem;
}

.chart-container canvas {
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* Mini Chart Styles */
.mini-chart-container {
    position: relative;
    height: 120px;
    margin-bottom: 0.5rem;
}

/* Main Chart Styles */
.main-chart-container {
    position: relative;
    height: 250px;
    margin-bottom: 1rem;
}

/* Responsive Chart Adjustments */
@media (max-width: 768px) {
    .main-chart-container {
        height: 200px;
    }
    
    .mini-chart-container {
        height: 100px;
    }
}

@media (max-width: 576px) {
    .main-chart-container {
        height: 180px;
    }
    
    .mini-chart-container {
        height: 80px;
    }
}
