/* ==========================================
   THEME SWITCHER - ESTILOS BASE
   ========================================== */

.theme-switcher-dropdown {
    margin-right: 10px;
}

.theme-switcher-dropdown .dropdown-menu {
    padding: 5px 0;
}

.theme-switcher-dropdown .theme-option {
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-switcher-dropdown .theme-option:hover {
    background-color: #f5f5f5;
}

.theme-switcher-dropdown .theme-option i:first-child {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.theme-switcher-dropdown .theme-check {
    color: #28a745;
    font-weight: bold;
}

/* Transición suave al cambiar tema */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================
   MODO OSCURO - VARIABLES Y ESTILOS
   ========================================== */

body.dark-theme {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Panels y Cards */
body.dark-theme .panel,
body.dark-theme .panel_s,
body.dark-theme .panel-default,
body.dark-theme .card {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .panel-heading,
body.dark-theme .panel-footer {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .panel-body {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

/* Tablas */
body.dark-theme .table {
    color: #e0e0e0 !important;
    background-color: #2d2d2d !important;
}

body.dark-theme .table thead th {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .table tbody tr {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.dark-theme .table tbody tr:hover {
    background-color: #353535 !important;
}

body.dark-theme .table-striped tbody tr:nth-of-type(odd) {
    background-color: #323232 !important;
}

body.dark-theme .table td,
body.dark-theme .table th {
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Formularios */
body.dark-theme .form-control,
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"],
body.dark-theme select,
body.dark-theme textarea {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .form-control:focus {
    background-color: #2d2d2d !important;
    border-color: #5a5a5a !important;
    color: #e0e0e0 !important;
}

/* Dropdowns y Select2 */
body.dark-theme .dropdown-menu {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.dark-theme .dropdown-menu > li > a {
    color: #e0e0e0 !important;
}

body.dark-theme .dropdown-menu > li > a:hover,
body.dark-theme .dropdown-menu > li > a:focus {
    background-color: #353535 !important;
    color: #fff !important;
}

body.dark-theme .select2-container--default .select2-selection--single,
body.dark-theme .select2-container--default .select2-selection--multiple {
    background-color: #252525 !important;
    border-color: #404040 !important;
}

body.dark-theme .select2-dropdown {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.dark-theme .select2-results__option {
    color: #e0e0e0 !important;
}

body.dark-theme .select2-results__option--highlighted {
    background-color: #353535 !important;
}

/* Sidebar */
body.dark-theme #wrapper #side-menu,
body.dark-theme .sidebar {
    background-color: #1f1f1f !important;
}

body.dark-theme .sidebar ul li a {
    color: #b0b0b0 !important;
}

body.dark-theme .sidebar ul li a:hover,
body.dark-theme .sidebar ul li a.active {
    background-color: #2d2d2d !important;
    color: #fff !important;
}

/* Header/Navbar */
body.dark-theme .navbar,
body.dark-theme .navbar-default {
    background-color: #1f1f1f !important;
    border-color: #404040 !important;
}

body.dark-theme .navbar-default .navbar-nav > li > a {
    color: #b0b0b0 !important;
}

body.dark-theme .navbar-default .navbar-nav > li > a:hover,
body.dark-theme .navbar-default .navbar-nav > li > a:focus {
    color: #fff !important;
    background-color: #2d2d2d !important;
}

/* Modales */
body.dark-theme .modal-content {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    background-color: #252525 !important;
    border-color: #404040 !important;
}

body.dark-theme .modal-title {
    color: #e0e0e0 !important;
}

body.dark-theme .close {
    color: #e0e0e0 !important;
    opacity: 0.8;
}

/* Breadcrumbs */
body.dark-theme .breadcrumb {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .breadcrumb > li a {
    color: #6c9bd1 !important;
}

/* Paginación */
body.dark-theme .pagination > li > a,
body.dark-theme .pagination > li > span {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .pagination > li > a:hover {
    background-color: #353535 !important;
    border-color: #404040 !important;
}

body.dark-theme .pagination > .active > a,
body.dark-theme .pagination > .active > span {
    background-color: #428bca !important;
    border-color: #428bca !important;
}

/* Wells */
body.dark-theme .well {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Alerts */
body.dark-theme .alert-info {
    background-color: #1f4e78 !important;
    border-color: #2e6da4 !important;
    color: #c9e2f7 !important;
}

body.dark-theme .alert-warning {
    background-color: #7a5c28 !important;
    border-color: #a67f3a !important;
    color: #f9e4b8 !important;
}

body.dark-theme .alert-danger {
    background-color: #7a2828 !important;
    border-color: #a43a3a !important;
    color: #f7c9c9 !important;
}

body.dark-theme .alert-success {
    background-color: #2d5a2d !important;
    border-color: #3a7a3a !important;
    color: #c9f7c9 !important;
}

/* Labels y Badges */
body.dark-theme .label-default {
    background-color: #3a3a3a !important;
}

body.dark-theme .label-info {
    background-color: #31708f !important;
}

body.dark-theme .label-warning {
    background-color: #8a6d3b !important;
}

body.dark-theme .label-danger {
    background-color: #a94442 !important;
}

body.dark-theme .label-success {
    background-color: #3c763d !important;
}

/* Textos y Enlaces */
body.dark-theme h1, 
body.dark-theme h2, 
body.dark-theme h3, 
body.dark-theme h4, 
body.dark-theme h5, 
body.dark-theme h6 {
    color: #e0e0e0 !important;
}

body.dark-theme p,
body.dark-theme span,
body.dark-theme div,
body.dark-theme label {
    color: #e0e0e0 !important;
}

body.dark-theme a {
    color: #6c9bd1 !important;
}

body.dark-theme a:hover {
    color: #8fb3e0 !important;
}

body.dark-theme .text-muted {
    color: #888 !important;
}

/* Bordes y separadores */
body.dark-theme hr {
    border-color: #404040 !important;
}

body.dark-theme .hr-panel-heading {
    border-color: #404040 !important;
}

/* DataTables */
body.dark-theme .dataTables_wrapper {
    color: #e0e0e0 !important;
}

body.dark-theme .dataTables_filter input,
body.dark-theme .dataTables_length select {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .dataTables_info,
body.dark-theme .dataTables_length label,
body.dark-theme .dataTables_filter label {
    color: #e0e0e0 !important;
}

/* Calendar/Datepicker */
body.dark-theme .datepicker,
body.dark-theme .daterangepicker {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .datepicker table tr td,
body.dark-theme .datepicker table tr th {
    color: #e0e0e0 !important;
}

body.dark-theme .datepicker table tr td.active {
    background-color: #428bca !important;
}

/* Fix para iconos que quedan invisibles */
body.dark-theme .fa,
body.dark-theme .glyphicon {
    color: inherit;
}

/* Content wrapper */
body.dark-theme #wrapper,
body.dark-theme .content {
    background-color: #1a1a1a !important;
}

/* Scrollbars (solo webkit) */
body.dark-theme ::-webkit-scrollbar {
    width: 12px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #252525;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 6px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #505050;
}
