@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Global Reset & Core Styling --- */
body {
    font-family: 'Inter', sans-serif !important;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

/* --- Premium welcome-section --- */
.welcome-section {
    background: linear-gradient(135deg, #3a4651 0%, #1e293b 100%);
    color: #ffffff;
    padding: 50px 0 70px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 80%);
    pointer-events: none;
}

.welcome-section h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.welcome-section p {
    font-size: 1.05rem;
    color: #cbd5e1;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* --- Calendar Container --- */
.cal-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    margin-top: -35px;
    margin-bottom: 60px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* --- Navigation & Typography --- */
.cal-container h4 {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-outline-primary {
    color: #3a4651 !important;
    border-color: #cbd5e1 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
}

.btn-outline-primary:hover, 
.btn-outline-primary:focus, 
.btn-outline-primary:active {
    background-color: #3a4651 !important;
    color: #ffffff !important;
    border-color: #3a4651 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 70, 81, 0.15);
}

.btn-outline-primary.disabled {
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
}

/* --- Responsive Calendar Grid --- */
.cal-grid {
    display: grid;
    grid-template-columns: 64px repeat(6, 1fr);
    min-width: 850px; /* Force overflow-x scrolling inside .table-responsive for perfect tablet/mobile sizing */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* --- Header Day Headers --- */
.ch-empty {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.ch-day {
    text-align: center;
    padding: 14px 8px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ch-day:last-child {
    border-right: none;
}

.ch-day .small {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ch-day .fw-bold {
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 700;
}

/* --- Hours & Grid Cells --- */
.ct-hour {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    border-bottom: 1px solid #edf2f7;
    min-height: 48px;
}

.ct-cell {
    border-right: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    background: #ffffff;
}

.ct-cell:nth-child(7n) {
    border-right: none;
}

/* --- Slot Button States --- */
.slot {
    width: 100%;
    height: 100%;
    min-height: 38px;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.slot.libre {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.slot.libre:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.slot.ocupado {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    cursor: not-allowed;
}

.slot.ocupado:hover {
    background: #e2e8f0;
}

.slot.pasado {
    background: #f8fafc;
    color: #cbd5e1;
    border: 1px solid #edf2f7;
    cursor: not-allowed;
}

/* --- Custom Modal Styling --- */
.modal-content {
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.modal-header {
    border-bottom: none !important;
    background: linear-gradient(135deg, #3a4651 0%, #1e293b 100%) !important;
    padding: 24px 28px !important;
}

.modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.modal-body {
    padding: 28px !important;
    background-color: #ffffff;
}

.modal-footer {
    border-top: none !important;
    padding: 0 28px 28px 28px !important;
    background-color: #ffffff;
}

.form-label {
    color: #344054;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #3a4651;
    box-shadow: 0 0 0 4px rgba(58, 70, 81, 0.15);
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-color: #d0d5dd;
    border-color: #d0d5dd;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: #3a4651;
    border-color: #3a4651;
}

.btn-primary {
    background-color: #3a4651 !important;
    border-color: #3a4651 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
}

.btn-primary:hover, 
.btn-primary:focus, 
.btn-primary:active {
    background-color: #1e293b !important;
    border-color: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 70, 81, 0.2) !important;
}

.btn-light {
    background-color: #f1f5f9 !important;
    border-color: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.btn-light:hover {
    background-color: #e2e8f0 !important;
    border-color: #e2e8f0 !important;
}

/* Success Modal Styles */
#modalExito .text-success i {
    filter: drop-shadow(0 4px 6px rgba(34, 197, 94, 0.2));
}

#modalExito h2 {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#modalExito .bg-light {
    background-color: #f8fafc !important;
    border: 1px dashed rgba(58, 70, 81, 0.2) !important;
}

/* Scrollbar styling */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
