/**
 * Custom Color Theme for IluFuturo SaaS
 * Sobrescribe las variables CSS de Bootstrap 5 para personalizar colores
 */

:root {
    /* Colores primarios */
    --bs-primary: #26c6da;
    /* Color principal (turquesa) */
    --bs-primary-rgb: 38, 198, 218;

    /* Colores secundarios */
    --bs-secondary: #4B515D;
    /* Color secundario (gris oscuro) */
    --bs-secondary-rgb: 75, 81, 93;

    /* Colores de estado */
    --bs-success: #28a745;
    /* Verde para éxito */
    --bs-success-rgb: 40, 167, 69;

    --bs-danger: #dc3545;
    /* Rojo para peligro/error */
    --bs-danger-rgb: 220, 53, 69;

    --bs-warning: #ffc107;
    /* Amarillo para advertencias */
    --bs-warning-rgb: 255, 193, 7;

    --bs-info: #17a2b8;
    /* Azul para información */
    --bs-info-rgb: 23, 162, 184;

    --bs-light: #f8f9fa;
    /* Gris claro */
    --bs-light-rgb: 248, 249, 250;

    --bs-dark: #343a40;
    /* Gris oscuro */
    --bs-dark-rgb: 52, 58, 64;

    /* Colores de fondo y texto */
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;

    /* Colores de enlaces */
    --bs-link-color: #26c6da;
    --bs-link-hover-color: #1fb5cb;

    /* Colores de bordes */
    --bs-border-color: #dee2e6;
    --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
}

/* Personalizaciones específicas para el tema médico */
.navbar-brand {
    color: var(--bs-primary) !important;
}

.title-shadow {
    background: linear-gradient(135deg, var(--bs-primary), #1fb5cb);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Modern Sidebar Styles - Override legacy styles */
.sidebar {
    background: linear-gradient(180deg, #f8f9fa, #e9ecef) !important;
    min-height: calc(100vh - 70px) !important;
    /* Full height minus navbar */
    position: fixed !important;
    top: 70px !important;
    /* Below navbar */
    left: 0 !important;
    z-index: 1000 !important;
    width: 250px !important;
    /* Fixed width instead of percentage */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    border-right: 1px solid #dee2e6 !important;
    padding: 0 !important;
    /* Override any legacy padding */
}

.sidebar-header {
    background: rgba(38, 198, 218, 0.1);
    border-bottom: 1px solid #dee2e6 !important;
}

.sidebar-brand {
    color: var(--bs-dark);
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-toggle {
    color: var(--bs-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-toggle:hover {
    color: var(--bs-primary);
}

.sidebar-content {
    padding: 1rem 0.5rem;
}

.sidebar .nav-link {
    color: var(--bs-dark);
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(38, 198, 218, 0.1);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background-color: var(--bs-primary) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(38, 198, 218, 0.3);
}

.sidebar-icon {
    font-size: 1rem;
    opacity: 0.9;
}

.sidebar-text {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    background: rgba(38, 198, 218, 0.05);
    border-top: 1px solid #dee2e6 !important;
    color: var(--bs-secondary);
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Responsive Sidebar */
@media (max-width: 767.98px) {
    .sidebar {
        width: 280px !important;
        top: 70px !important;
        /* Below navbar on mobile too */
        height: calc(100vh - 70px) !important;
        transform: translateX(-100%) !important;
    }

    .sidebar.show {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 70px !important;
        /* Space for navbar on mobile */
    }
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 250px !important;
        /* Match fixed sidebar width */
        padding-top: 70px !important;
        /* Space for fixed navbar */
    }
}

/* Sidebar animation improvements */
.sidebar .nav-link {
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--bs-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar .nav-link.active::before {
    transform: scaleY(1);
}

/* Legacy compatibility */
.sidebar-option-selected {
    background-color: var(--bs-primary) !important;
    color: white !important;
}

/* Botones personalizados */
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #1fb5cb;
    --bs-btn-hover-border-color: #1fb5cb;
    --bs-btn-active-bg: #1a9fb5;
    --bs-btn-active-border-color: #1a9fb5;
}

/* Cards personalizadas */
.card-header.bg-primary {
    background: linear-gradient(135deg, var(--bs-primary), #1fb5cb) !important;
}

/* Badges personalizados */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Formularios */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(38, 198, 218, 0.25);
}

/* Alertas personalizadas para tema médico */
.alert-medical {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-appointment {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Estados de citas */
.status-confirmed {
    color: var(--bs-success);
}

.status-pending {
    color: var(--bs-warning);
}

.status-cancelled {
    color: var(--bs-danger);
}

.status-completed {
    color: var(--bs-primary);
}

/* Body modifications when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* Mobile toggle button styles */
.sidebar-toggle {
    border: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease !important;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.sidebar-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
    color: white !important;
}

/* Ensure navbar stays above sidebar */
#page_layout_navbar {
    position: relative;
    z-index: 1050;
}

/* Improve navbar spacing on mobile */
@media (max-width: 767.98px) {
    #page_layout_navbar {
        padding: 0.75rem 1rem !important;
    }

    #page_layout_navbar .h5 {
        font-size: 1rem !important;
    }

    #page_layout_navbar img {
        width: 80px !important;
        height: 35px !important;
    }
}