/* DentalSoft Custom Styles - Tema Oscuro */

/* Color scheme - Tema Oscuro */
:root {
    --primary-color: #1a237e;      /* Azul marino profundo */
    --secondary-color: #37474f;    /* Gris azulado */
    --success-color: #2e7d32;      /* Verde médico */
    --danger-color: #d32f2f;       /* Rojo médico */
    --warning-color: #f57c00;      /* Naranja médico */
    --info-color: #0288d1;         /* Azul información */
    --light-color: #263238;        /* Gris oscuro claro */
    --dark-color: #121212;         /* Negro profundo */
    --sidebar-width: 320px;
    
    /* Colores del tema oscuro */
    --bg-primary: #121212;         /* Fondo principal */
    --bg-secondary: #1e1e1e;       /* Fondo secundario */
    --bg-tertiary: #2d2d2d;        /* Fondo terciario */
    --text-primary: #ffffff;       /* Texto principal */
    --text-secondary: #b3b3b3;     /* Texto secundario */
    --border-color: #404040;       /* Color de bordes */
    --accent-color: #64b5f6;       /* Color de acento */
}

/* Body and layout - Tema Oscuro */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* App Container - Tema Oscuro */
.app-container {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: block;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Sidebar Fixed - Tema Oscuro */
.sidebar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #0d47a1);
    border-right: 2px solid var(--accent-color);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    margin: 0;
}

.sidebar-header {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    margin: 0;
    text-align: center;
}

.sidebar-header h4 {
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-menu {
    flex: 1;
    padding-top: 1.5rem;
    margin: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 2px solid var(--accent-color);
    text-align: center;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Main Content - Tema Oscuro */
.main-content {
    position: relative;
    margin-left: var(--sidebar-width);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding: 0;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    display: block;
    float: none;
    color: var(--text-primary);
    border-left: 2px solid var(--border-color);
    box-sizing: border-box;
}

/* Contenido interno con bordes y espaciado */
.content-wrapper {
    padding: 2rem;
    margin: 0;
    background-color: var(--bg-secondary);
    border-radius: 0;
}

/* Headers y títulos */
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4,
.main-content h5,
.main-content h6 {
    color: var(--text-primary);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--accent-color);
    content: ">";
}

/* Sidebar Navigation - Tema Oscuro */
.sidebar-fixed .nav-link {
    padding: 15px 20px;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    overflow: visible; /* Cambiado para evitar cortes */
}

.sidebar-fixed .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.sidebar-fixed .nav-link:hover::before {
    left: 100%;
}

.sidebar-fixed .nav-link:hover {
    background-color: rgba(255,255,255,0.15);
    color: #ffffff !important;
    transform: translateX(5px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.sidebar-fixed .nav-link.active {
    background-color: var(--accent-color);
    color: var(--dark-color) !important;
    font-weight: 700;
    border-color: #ffffff;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.4);
}

.sidebar-fixed .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Responsive Design - Updated */
@media (max-width: 768px) {
    .sidebar-fixed {
        transform: translateX(-100%);
        margin: 0;
        padding: 0;
    }
    
    .sidebar-fixed.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .app-container {
        margin: 0;
        padding: 0;
    }
}

/* Asegurar que NO haya apilamiento vertical - Updated */
@media (min-width: 769px) {
    .sidebar-fixed {
        position: fixed !important;
        display: block !important;
        float: none !important;
    }
    
    .main-content {
        display: block !important;
        float: none !important;
        clear: none !important;
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
        max-width: calc(100% - var(--sidebar-width)) !important;
        box-sizing: border-box !important;
    }
}

/* Eliminar espacios adicionales de Bootstrap - Updated */
.container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
    width: 100%;
}

/* Asegurar que todos los elementos del main-content usen el ancho completo */
.main-content .container-fluid {
    width: 100%;
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* Prevenir colapso de layout - Updated */
body {
    overflow-x: hidden; /* Prevenir scroll horizontal */
    overflow-y: auto; /* Permitir scroll vertical completo */
    height: auto; /* Altura automática */
    min-height: 100vh; /* Mínimo de viewport */
}

.app-container {
    width: 100%;
    max-width: 100%;
    position: relative;
}

.app-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Main content without gaps - Updated for better layout */
.main-content {
    min-height: 100vh;
    height: auto; /* Altura automática */
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    padding: 0;
    padding-bottom: 2rem; /* Espacio al final */
    box-sizing: border-box;
    overflow: visible; /* Visible para evitar cortes */
}

.main-content .navbar {
    margin: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.main-content .container-fluid {
    margin: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
}

/* Cards y componentes - Tema Oscuro */
.card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: var(--accent-color);
}

.card-header {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--accent-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1.25rem;
}

.card-body {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Buttons - Tema Oscuro */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3f51b5);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3f51b5, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #4caf50);
    color: var(--text-primary);
    border-color: var(--success-color);
}

.btn-success:hover {
    background: linear-gradient(135deg, #4caf50, var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f44336);
    color: var(--text-primary);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f44336, var(--danger-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ff9800);
    color: var(--dark-color);
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9800, var(--warning-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 124, 0, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #2196f3);
    color: var(--text-primary);
    border-color: var(--info-color);
}

.btn-info:hover {
    background: linear-gradient(135deg, #2196f3, var(--info-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 136, 209, 0.4);
}

/* Tables - Tema Oscuro */
.table {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.table-dark {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.table thead th {
    background-color: var(--primary-color);
    color: var(--text-primary);
    border-color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.01);
}

.table tbody td {
    border-color: var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

/* Layout optimization for content width */
.main-content .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.main-content .table {
    width: 100%;
    margin-bottom: 0;
}

.main-content .card {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.main-content .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.main-content .col,
.main-content .col-md-12,
.main-content .col-lg-12,
.main-content [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Ensure form elements use available width */
.main-content .form-control,
.main-content .form-select {
    width: 100%;
    max-width: 100%;
}

/* Button groups and toolbars */
.main-content .btn-toolbar {
    width: 100%;
    justify-content: space-between;
}

/* Pagination */
.main-content .pagination {
    margin: 1rem 0;
    justify-content: center;
}

/* Search and filter bars */
.main-content .d-flex {
    width: 100%;
}

.main-content .d-flex .form-control {
    flex: 1;
}

/* Forms - Tema Oscuro */
.form-control {
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(100, 181, 246, 0.25);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.form-select {
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(100, 181, 246, 0.25);
    color: var(--text-primary);
}

/* Alerts - Tema Oscuro */
.alert {
    border-radius: 12px;
    border: 2px solid transparent;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(46, 125, 50, 0.2);
    border-color: var(--success-color);
    color: #a5d6a7;
}

.alert-danger {
    background-color: rgba(211, 47, 47, 0.2);
    border-color: var(--danger-color);
    color: #ef9a9a;
}

.alert-warning {
    background-color: rgba(245, 124, 0, 0.2);
    border-color: var(--warning-color);
    color: #ffcc02;
}

.alert-info {
    background-color: rgba(2, 136, 209, 0.2);
    border-color: var(--info-color);
    color: #81d4fa;
}

/* Modal - Tema Oscuro */
.modal-content {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.modal-header {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--accent-color);
    color: var(--text-primary);
}

.modal-body {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

/* Badges - Tema Oscuro */
.badge {
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Nav tabs - Tema Oscuro */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.nav-tabs .nav-link.active {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border-color: var(--accent-color);
    font-weight: 700;
}

.tab-content {
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    color: var(--text-primary);
}

/* Progress bars - Tema Oscuro */
.progress {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 20px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-color), #42a5f5);
    border-radius: 8px;
    transition: width 0.6s ease;
}

/* Pagination - Tema Oscuro */
.pagination .page-link {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--dark-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* Dashboard específico */
.dashboard-stats {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #3f51b5);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(100, 181, 246, 0.3);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-card p {
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Text colors override para Bootstrap */
.text-white { color: var(--text-primary) !important; }
.text-light { color: var(--text-secondary) !important; }
.text-dark { color: var(--text-primary) !important; }
.text-muted { color: var(--text-secondary) !important; }

/* Background colors override */
.bg-dark { background-color: var(--bg-primary) !important; }
.bg-light { background-color: var(--bg-tertiary) !important; }
.bg-white { background-color: var(--bg-secondary) !important; }

/* Custom utilities */
.text-xs {
    font-size: 0.8rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Chart containers */
.chart-area {
    position: relative;
    height: 400px;
}

.chart-pie {
    position: relative;
    height: 250px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }
    
    #sidebar.show {
        margin-left: 0;
    }
    
    main {
        margin-left: 0 !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* File upload */
.custom-file-input::-webkit-file-upload-button {
    visibility: hidden;
}

.custom-file-input::before {
    content: 'Seleccionar archivo';
    display: inline-block;
    background: linear-gradient(top, #f9f9f9, #e3e3e3);
    border: 1px solid #999;
    border-radius: 3px;
    padding: 5px 8px;
    outline: none;
    white-space: nowrap;
    cursor: pointer;
    text-shadow: 1px 1px #fff;
    font-weight: 700;
    font-size: 10pt;
}

.custom-file-input:hover::before {
    border-color: black;
}

.custom-file-input:active::before {
    background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}

/* Odontogram styles */
.odontogram-container {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.tooth {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tooth:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.tooth.caries {
    fill: #dc3545;
}

.tooth.restoration {
    fill: #28a745;
}

.tooth.extraction {
    fill: #6c757d;
}

.tooth.crown {
    fill: #ffc107;
}

/* Calendar styles */
.fc-theme-standard .fc-toolbar {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.fc-event {
    border-radius: 5px;
    font-size: 0.85rem;
}

/* Print styles */
@media print {
    #sidebar,
    .navbar,
    .btn-toolbar {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .table {
        color: #ffffff;
    }
    
    .table thead th {
        background-color: #3a3a3a;
        color: #ffffff;
    }
}

/* ===============================================
   VISOR DE IMÁGENES CLÍNICAS
   =============================================== */

/* Modal del visor de imágenes */
#imageViewerModal .modal-content {
    background-color: rgba(0, 0, 0, 0.95) !important;
    border: none;
    border-radius: 0.5rem;
}

#imageViewerModal .modal-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem 0.5rem;
}

#imageViewerModal .modal-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
}

#imageViewerModal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

#imageViewerModal .modal-body {
    padding: 0.5rem;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

#imageViewerModal #modalImage {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

#imageViewerModal #modalImage:hover {
    transform: scale(1.02);
}

#imageViewerModal .modal-footer {
    background-color: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem 1rem;
}

#imageViewerModal .modal-footer small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Loading state para imágenes */
#imageViewerModal .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.7);
}

#imageViewerModal .loading::before {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive para el visor */
@media (max-width: 768px) {
    #imageViewerModal .modal-dialog {
        margin: 0;
        height: 100vh;
        max-width: 100%;
    }
    
    #imageViewerModal .modal-content {
        height: 100vh;
        border-radius: 0;
    }
    
    #imageViewerModal #modalImage {
        max-height: 75vh;
    }
}

/* Cursor pointer para botones ver de imágenes */
.document-view-btn.image-file {
    background-color: var(--info-color) !important;
    border-color: var(--info-color) !important;
}

.document-view-btn.image-file:hover {
    background-color: #0277bd !important;
    border-color: #0277bd !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* ===============================================
   FIN VISOR DE IMÁGENES CLÍNICAS
   =============================================== */

/* ===============================================
   FOOTER FIJO - STICKY FOOTER
   =============================================== */

/* Footer fijo en la parte inferior */
.fixed-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: var(--sidebar-width) !important; /* Comienza donde termina el sidebar */
    right: 0 !important;
    width: calc(100% - var(--sidebar-width)) !important; /* Ancho ajustado al contenido */
    z-index: 1030 !important; /* Por encima del contenido pero debajo de modales */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Ajustar el body para dar espacio al footer fijo */
body {
    padding-bottom: 80px !important; /* Ajustar según la altura del footer */
}

/* Ajustar el contenido principal para evitar que se oculte detrás del footer */
.app-container {
    padding-bottom: 80px !important;
}

/* Asegurar que el footer se vea bien en dispositivos móviles */
@media (max-width: 768px) {
    .fixed-footer {
        font-size: 0.9rem !important;
        left: 0 !important; /* En móviles ocupa todo el ancho */
        width: 100% !important;
    }
    
    .fixed-footer .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    body, .app-container {
        padding-bottom: 100px !important; /* Más espacio en móviles */
    }
}

/* Estilo especial para texto del footer */
.fixed-footer p {
    margin-bottom: 0 !important;
    font-weight: 500 !important;
}

.fixed-footer a {
    color: #64b5f6 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.fixed-footer a:hover {
    color: #90caf9 !important;
    text-decoration: underline !important;
}

/* ===============================================
   FIN FOOTER FIJO
   =============================================== */
