/* ================================================
   VARIABLES Y COLORES
   ================================================ */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --light-bg: #f7fafc;
    --border-color: #e2e8f0;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ================================================
   RESET Y BASE
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ================================================
   TIPOGRAFÃƒÆ’Ã‚ÂA
   ================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
}

.fw-600 {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.lead {
    font-size: 1.1rem;
    font-weight: 400;
}

/* ================================================
   NAVBAR
   ================================================ */

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-custom .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

.navbar-custom .nav-link.text-danger {
    color: #ff6b6b !important;
}

.navbar-custom .nav-link.text-danger:hover {
    color: #ff5252 !important;
}

/* ================================================
   MAIN CONTENT
   ================================================ */

.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* ================================================
   CARDS
   ================================================ */

.card {
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color) !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color) !important;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%) !important;
}

.card-stat {
    border-top: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.card-stat:hover {
    border-top-color: var(--secondary-color);
    transform: translateY(-10px);
}

/* ================================================
   FORMULARIOS
   ================================================ */

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-select-lg {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-control-lg {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
}

.form-label {
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.25em;
    height: 1.25em;
    border: 2px solid var(--border-color);
    border-radius: 0.25em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    margin-left: 0.5rem;
}

/* ================================================
   BOTONES
   ================================================ */

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #663399 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #38a169;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #e53e3e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ================================================
   TOASTS FLOTANTES - MENSAJES MODERNOS
   ================================================ */

.toasts-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 12px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.toast-content i {
    font-size: 1.3rem;
    margin-top: 2px;
    flex-shrink: 0;
    animation: toastIconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-texto {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-texto strong {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.toast-texto p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Success Toast */
.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-success i {
    color: #d1fae5;
}

/* Danger Toast */
.toast-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-danger i {
    color: #fee2e2;
}

/* Warning Toast */
.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast-warning i {
    color: #fef3c7;
}

/* Info Toast */
.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-info i {
    color: #dbeafe;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastIconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.toast-salida {
    animation: toastSlideOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(400px) scale(0.9);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .toasts-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast-item {
        min-width: auto;
        max-width: 100%;
    }
}

/* ================================================
   HORARIOS DISPONIBLES
   ================================================ */

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.horario-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.horario-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
}

.horario-btn.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.horario-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--light-bg);
}

/* ================================================
   SOLICITUD CARD
   ================================================ */

.solicitud-card {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    transition: all 0.3s ease;
}

.solicitud-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.solicitud-card .badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* ================================================
   FOOTER
   ================================================ */

.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin-bottom: 0;
}

/* ================================================
   TABS
   ================================================ */

.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

/* ================================================
   MODALES
   ================================================ */

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.modal-header .btn-close {
    opacity: 0.5;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }

    .card {
        margin-bottom: 1rem;
    }

    .horarios-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .navbar-custom .navbar-brand {
        font-size: 1.25rem;
    }

    .display-4 {
        font-size: 2rem !important;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    .display-1 {
        font-size: 4rem !important;
    }
}

/* ================================================
   ANIMACIONES
   ================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ================================================
   UTILIDADES
   ================================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.bg-light {
    background-color: var(--light-bg) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-4 {
    border-radius: 12px !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* ================================================
   SCROLL
   ================================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ================================================
   SELECTOR DE HORAS (Visual Range)
   ================================================ */

.hora-btn {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-align: center;
}

.hora-btn:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

.hora-btn.selected {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.hora-btn.rango {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-color: #667eea;
}