/* Archivo: styles.css - Sistema de Reposos Médicos HCPRC */

/* Variables CSS para consistencia de colores */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1e4080;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fc;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-800: #495057;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-medical: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Estilos globales mejorados */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--gradient-medical);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fondo animado sutil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    z-index: -1;
    animation: floating 20s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

/* Header principal con estilo médico */
.header-container {
    background: var(--white);
    box-shadow: var(--shadow-medium);
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.header-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100px;
    background: var(--gradient-primary);
    clip-path: polygon(50% 0%, 100% 0%, 100% 100%);
    opacity: 0.1;
}

/* Barra de navegación superior */
.navbar-custom {
    padding: 15px 0;
    background: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    box-shadow: var(--shadow-soft);
}

.logout-btn {
    background: var(--gradient-secondary);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    color: white;
}

/* Títulos mejorados */
h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.8rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* Contenedores principales */
.main-container {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
    max-width: 95%;
}

.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Botones mejorados */
.btn {
    border-radius: 10px;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--gradient-medical);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

/* Formularios mejorados */
.form-control {
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    background-color: var(--gray-100);
    font-size: 16px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
    background-color: var(--white);
    transform: translateY(-1px);
}

.form-label {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modales mejorados */
.modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
    padding: 20px 30px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

.modal-body {
    padding: 30px;
    background: var(--gray-100);
}

.modal-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 20px 30px;
}

/* Tablas modernas */
.table-container {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin: 20px 0;
}

table.table {
    margin-bottom: 0;
    border: none;
}

table.table thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 20px 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: relative;
}

table.table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.3);
}

table.table tbody td {
    padding: 15px;
    border-top: 1px solid var(--gray-200);
    vertical-align: middle;
    transition: all 0.3s ease;
}

table.table tbody tr:hover {
    background: var(--gray-100);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* DataTables personalizado */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--white);
    color: var(--dark-color);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* Alertas modernas */
.alert {
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-soft);
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: var(--warning-color);
    color: #856404;
}

/* Cards mejoradas */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    background: var(--white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
    padding: 20px 25px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* Login especial */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-medical);
    position: relative;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: var(--gradient-primary);
    padding: 30px;
    text-align: center;
    color: white;
}

.login-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.login-body {
    padding: 30px;
}

/* Responsive Design Mejorado */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .navbar-custom {
        padding: 10px 0;
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        width: 100%;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    table.table thead th,
    table.table tbody td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .badge {
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .form-control {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .input-group-text {
        padding: 12px;
    }
    
    /* Ocultar columnas menos importantes en móviles */
    .table-responsive th:nth-child(2),
    .table-responsive td:nth-child(2),
    .table-responsive th:nth-child(6),
    .table-responsive td:nth-child(6) {
        display: none;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 10px 15px;
        font-size: 12px;
        margin: 3px 0;
        display: block;
        width: 100%;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-control {
        padding: 12px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    /* Stack botones en móvil */
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .logout-btn,
    .btn-outline-primary {
        width: 100%;
        margin: 2px 0;
    }
    
    /* Ajustar tabla para móviles */
    .table-responsive {
        font-size: 11px;
    }
    
    .table-responsive th:nth-child(3),
    .table-responsive td:nth-child(3),
    .table-responsive th:nth-child(8),
    .table-responsive td:nth-child(8) {
        display: none;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 4px;
    }
}

/* Animaciones suaves */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Efectos de hover para interactividad */
.interactive-element {
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Links sin decoración para cards */
a.text-decoration-none .card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-strong);
}

a.text-decoration-none .card {
    transition: all 0.3s ease;
}

/* Estilos específicos para reportes y configuración */
.stats-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-100) 100%);
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gráficos y charts */
.chart-container {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

/* Tablas en reportes */
.table-sm th,
.table-sm td {
    padding: 8px 12px;
    font-size: 13px;
}

/* Switches personalizados */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.25);
}

/* Configuración específica */
.config-section {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border-left: 4px solid var(--primary-color);
}

/* Información del sistema */
.system-info {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Estados de indicadores */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-online {
    background-color: var(--success-color);
    animation: pulse-green 2s infinite;
}

.status-offline {
    background-color: var(--danger-color);
    animation: pulse-red 2s infinite;
}

.status-warning {
    background-color: var(--warning-color);
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* Herramientas de mantenimiento */
.maintenance-tools .btn {
    position: relative;
    overflow: hidden;
}

.maintenance-tools .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.maintenance-tools .btn:hover::before {
    left: 100%;
}

/* Breadcrumb personalizado */
.custom-breadcrumb {
    background: var(--gradient-primary);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.custom-breadcrumb a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.custom-breadcrumb a:hover {
    color: white;
}

/* Efectos de carga */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
