/* ===================================
   WEDIGITEK - CONSOLIDATED STYLES
   ================================= */

/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #003DA5;
    --accent-color: #FF6B35;
    --light-bg: #F5F5F5;
    --text-dark: #333333;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: linear-gradient(135deg, #003DA5 0%, #00256B 100%) !important;
    z-index: 1000 !important;
    width: 16.666667%;
    min-width: 200px;
    transition: width 0.3s ease, min-width 0.3s ease;
}

.sidebar-logo-container {
    text-align: center;
}

.sidebar-logo {
    max-height: 40px;
    width: auto;
    max-width: 100%;
}

/* ===== COLLAPSED SIDEBAR ===== */
.sidebar.collapsed {
    width: 70px !important;
    min-width: 70px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Header container com toggle e logo */
.sidebar-header-container {
    transition: all 0.3s ease;
}

/* Esconder logo quando colapsado */
.sidebar.collapsed .sidebar-logo-container {
    display: none !important;
}

/* Centralizar botão de toggle quando colapsado */
.sidebar.collapsed .sidebar-toggle-btn {
    margin: 0 auto !important;
}

/* Nav items */
.sidebar.collapsed .nav-item {
    margin-bottom: 8px !important;
}

/* Nav links - apenas ícones centralizados */
.sidebar.collapsed .nav-link {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 4px !important;
    text-align: center !important;
    min-height: 45px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

/* Ícones sempre visíveis e centralizados */
.sidebar.collapsed .nav-link i {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.5rem !important;
    display: inline-block !important;
    position: relative !important;
}

/* Esconder o chevron completamente */
.sidebar.collapsed .nav-link .bi-chevron-down {
    display: none !important;
}

/* Esconder texto usando seletor universal para pegar TODOS os nós de texto */
.sidebar.collapsed .nav-link {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Restaurar tamanho dos ícones depois de font-size: 0 */
.sidebar.collapsed .nav-link i::before {
    font-size: 1.5rem !important;
}

/* Esconder completamente os submenus colapsáveis */
.sidebar.collapsed .collapse,
.sidebar.collapsed .collapsing,
.sidebar.collapsed .nav-item .collapse,
.sidebar.collapsed .nav-item .collapsing {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

.sidebar.collapsed ul.nav {
    display: none !important;
}

/* User menu no estado colapsado */
.sidebar.collapsed .user-menu-container {
    margin-bottom: 0 !important;
}

.sidebar.collapsed .user-menu-container .dropdown-toggle {
    padding: 12px 4px !important;
    justify-content: center !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.sidebar.collapsed .user-menu-container .bi-person-circle {
    margin: 0 !important;
    font-size: 1.8rem !important;
    display: block !important;
}

.sidebar.collapsed .user-menu-container .bi-person-circle::before {
    font-size: 1.8rem !important;
}

.sidebar.collapsed .user-menu-container .d-flex {
    justify-content: center !important;
}

.sidebar-toggle-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 40px;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
}

.desktop-only {
    display: flex;
}

.col-md-10 {
    margin-left: 16.666667% !important;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.col-md-10.sidebar-collapsed {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
}

/* Mobile header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #003DA5 0%, #00256B 100%);
    z-index: 1001;
    padding: 10px 15px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-header-logo {
    height: 35px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.mobile-menu-toggle {
    background: transparent;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    color: rgba(255,255,255,0.8);
}

/* ===== NAVIGATION LINKS ===== */
.nav-link {
    color: rgba(255,255,255,0.85) !important;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.15) !important;
    border-radius: 5px;
}

.nav-link.active {
    color: #fff !important;
    background: rgba(255, 107, 53, 0.3) !important;
    border-left: 3px solid #FF6B35 !important;
    padding-left: calc(1rem - 3px) !important;
    border-radius: 5px;
}

/* Collapsed state - reset border */
.sidebar.collapsed .nav-link.active {
    border-left: none !important;
    padding-left: 8px !important;
    background: rgba(255, 107, 53, 0.5) !important;
}

a.nav-link[href="/dashboard.php"] {
    color: rgba(255,255,255,0.85) !important;
}

a.nav-link[href="/dashboard.php"].active {
    color: #fff !important;
    background: rgba(255, 107, 53, 0.3) !important;
    border-left: 3px solid #FF6B35 !important;
}

/* Collapse menu styles */
.nav-link[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.3s ease;
}

.nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.collapse {
    transition: height 0.3s ease;
}

/* Tooltip customization for collapsed sidebar */
.tooltip {
    z-index: 1050 !important;
}

.tooltip-inner {
    background-color: rgba(0, 61, 165, 0.95) !important;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* ===== BUTTON STYLES ===== */
.btn-primary {
    background-color: #003DA5 !important;
    border-color: #003DA5 !important;
}

.btn-primary:hover {
    background-color: #002678 !important;
    border-color: #002678 !important;
}

/* ===== BADGE STYLES ===== */
.badge-primary {
    background-color: #003DA5 !important;
}

.badge-status {
    font-size: 0.85rem;
}

.badge {
    border: 1px solid #000;
    color: #000 !important;
}

/* ===== ALERT STYLES ===== */
.alert-info {
    background-color: #e7f3ff !important;
    border-color: #003DA5 !important;
    color: #003DA5 !important;
}

/* ===== CARD STYLES ===== */
.card-header {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #003DA5 !important;
}

.card-header h5 {
    color: #000 !important;
}

.card {
    page-break-inside: avoid;
    border: 1px solid #000 !important;
}

.card-body h3 {
    color: #000 !important;
}

/* ===== LANGUAGE SELECTOR ===== */
.language-selector {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: rgba(255,255,255,0.85) !important;
}

.language-selector option {
    background-color: #003DA5;
    color: white;
}

/* ===== HEADING STYLES ===== */
h2, h3, h4, h5, h6 {
    color: #000 !important;
}

/* ===== TAB STYLES ===== */
.tab-content {
    min-height: 400px;
}

.nav-tabs {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 4px solid #0d6efd;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-tabs .nav-item {
    margin-bottom: 0;
    margin-right: 5px;
}

.nav-tabs .nav-link {
    color: #333 !important;
    background-color: #d4d8e3;
    border: 2px solid #999;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0.75rem 1.5rem;
    margin: 0;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-tabs .nav-link:hover {
    background-color: #b8bfcc;
    color: #000 !important;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff !important;
    border-color: #0d6efd;
    border-bottom-color: #f8f9fa;
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(13, 110, 253, 0.3);
}

.nav-tabs .nav-link i {
    margin-right: 0.6rem;
    font-size: 1.1rem;
    color: #000 !important;
}

.nav-tabs .nav-link.active i {
    color: #fff !important;
}

/* ===== PILLS STYLES ===== */
.nav-pills {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px;
    border-radius: 8px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-pills .nav-item {
    margin-bottom: 5px;
}

.nav-pills .nav-link {
    color: #333 !important;
    background-color: #d4d8e3;
    border: 2px solid #999;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-pills .nav-link:hover {
    background-color: #b8bfcc;
    color: #000 !important;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff !important;
    border-color: #0d6efd;
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(13, 110, 253, 0.3);
}

.nav-pills .nav-link i {
    margin-right: 0.6rem;
    font-size: 1rem;
    color: inherit;
}

.nav-pills .nav-link.active i {
    color: #fff !important;
}

/* ===== FORM SECTION STYLES ===== */
.form-section {
    border-left: 3px solid #0d6efd;
    padding-left: 15px;
    margin-bottom: 20px;
}

.form-section h6 {
    color: #0d6efd;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ===== TABLE STYLES ===== */
.employee-table {
    font-size: 0.9rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table actions column - prevent wrapping */
.table td:last-child, .table th:last-child {
    white-space: nowrap;
}

/* ===== EMAIL TEMPLATE STYLES ===== */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 600px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header {
    color: #ffffff;
    padding: 30px 20px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 24px;
}

.header-success {
    background: #198754;
}

.header-warning {
    background: #ffc107;
    color: #000;
}

.header-info {
    background: #0d6efd;
}

.header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.content {
    padding: 30px 20px;
}

.credentials-box {
    background: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 20px;
    margin: 20px 0;
}

.success-box {
    background: #d1e7dd;
    border-left: 4px solid #198754;
    padding: 15px;
    margin: 20px 0;
}

.success-box strong {
    color: #198754;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
}

.info-box {
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 15px;
    margin: 20px 0;
}

.info-box strong {
    color: #0d6efd;
}

.button {
    display: inline-block;
    background: #0d6efd;
    color: #ffffff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    margin: 20px 0;
}

.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* ===== PRINT STYLES ===== */
@media print {
    .btn, .card-header form, .no-print {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        border: 1px solid #000 !important;
    }

    .badge {
        border: 1px solid #000;
        color: #000 !important;
    }
    
    .sidebar, .mobile-menu-toggle {
        display: none !important;
    }
    
    .col-md-10 {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablets and smaller desktops */
@media (max-width: 992px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 280px; /* Reset collapsed state on mobile */
        min-width: 280px;
    }
    
    .sidebar.collapsed .sidebar-logo-container,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .user-menu-container strong {
        display: block !important; /* Show all text on mobile */
    }
    
    .sidebar.collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.5rem 1rem !important;
        text-align: left;
    }
    
    .sidebar.collapsed .nav-link i {
        margin-right: 0.5rem !important;
        font-size: inherit;
    }
    
    .desktop-only,
    .sidebar-toggle-btn {
        display: none !important; /* Hide desktop toggle on mobile */
    }
    
    .col-md-10 {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 75px !important; /* Space for mobile header */
    }
    
    .col-md-10.sidebar-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .nav-tabs {
        padding: 5px;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .col-md-10 {
        padding: 15px;
    }
    
    /* Tables responsive */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th, table td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header h5 {
        font-size: 1.1rem;
    }
    
    /* Forms */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Tabs */
    .nav-tabs {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .nav-tabs .nav-item {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .nav-tabs .nav-link {
        border-radius: 6px;
        border: 2px solid #cbd5e1;
    }
    
    .nav-tabs .nav-link.active {
        border: 2px solid #0d6efd;
    }
    
    /* Pills */
    .nav-pills {
        flex-direction: column;
    }
    
    .nav-pills .nav-item {
        width: 100%;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 5px !important;
    }
    
    /* Stack form groups */
    .row > [class*="col-"] {
        margin-bottom: 0.75rem;
    }
    
    /* Email templates mobile */
    .container {
        margin: 10px auto;
        border-radius: 4px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .button {
        display: block;
        text-align: center;
        padding: 10px 20px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: auto;
        max-height: 100vh;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .badge, .nav-link {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can be enabled if needed */
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
