/* =========================
   BASE LAYOUT
========================= */

.calendar-container{
    display:flex;
    gap:30px;
    margin-top:20px;
    flex-wrap:wrap;
}

/* Calendar */
.calendar-wrapper{
    width: 420px;
    max-width: 100%;
    height: 320px;
}

/* Header */
.calendar-header{
    text-align:center;
    font-size:22px;
    font-weight:bold;
    margin-bottom:20px;
}

/* Grid */
.weekdays,
.calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:8px;
}

.weekday{
    text-align:center;
    font-weight:bold;
    color:#666;
    padding:10px 0;
}

/* Days */
.day,.empty{
    height:60px;
}

.day button{
    width:100%;
    height:100%;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-weight:600;
    transition:.2s;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:2px;
}

.day button small{
    font-size:10px;
    font-weight:500;
    opacity:.8;
}

/* States */
.available{
    background:#0024ee;
    color:#fff;
}

.full{
    background:#f1f1f1;
    color:#999;
    cursor:not-allowed;
}

.active-day{
    outline:3px solid #0d6efd;
}

.fully-booked {
    color: red;
    font-weight: bold;
}

/* =========================
   TIME SLOTS
========================= */

.time-slots{
    flex:1;
    min-width:100px;
    background:#fff;
    padding:15px;
    border-radius:10px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

.slot-card{
    padding:12px 15px;
    margin:10px 0;
    border-radius:10px;
    cursor:pointer;
    transition:0.2s;
    display:flex;
    justify-content:space-between;
    align-items:center;
    border:1px solid transparent;
}

.slot-card.available:hover{
    transform:scale(1.02);
    background:#dff1ff;
    border-color:#2563eb;
}

.slot-card.full{
    background:#f3f3f3;
    color:#888;
    cursor:not-allowed;
}

.slot-time{
    font-weight:600;
    font-size:15px;
}

.slot-status{
    font-size:13px;
    opacity:0.8;
}

.slot-empty{
    text-align:center;
    padding:30px;
    color:#777;
    font-size:14px;
}

/* =========================
   MODAL
========================= */

.modal {
    display:none;
    position:fixed;
    z-index:1000;
    inset:0;
    background:rgba(0,0,0,0.5);
}

.modal.show { display:block; }

.modal-content {
    background:#fff;
    padding:20px;
    margin:50px auto;
    max-width:400px;
    border-radius:10px;
    width:90%;
}

/* =========================
   ANIMATION SECTION
========================= */

#repSection {
    max-height:0;
    overflow:hidden;
    transition:0.4s;
}

#repSection.show {
    max-height:500px;
}

/* =========================
   📱 MOBILE RESPONSIVE
========================= */

@media (max-width: 768px){

    .calendar-container{
        flex-direction:column;
        gap:20px;
    }

    .calendar-wrapper{
        width:100%;
    }

    .calendar-header{
        font-size:18px;
    }

    .day,.empty{
        height:50px;
    }

    .day button{
        font-size:13px;
    }

    .weekdays,
    .calendar-grid{
        gap:5px;
    }

    .time-slots{
        min-width:100%;
        padding:12px;
    }

    .slot-card{
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
    }
}

@media (max-width: 480px){

    .calendar-header{
        font-size:16px;
    }

    .day,.empty{
        height:45px;
    }

    .day button small{
        font-size:9px;
    }

    .slot-time{
        font-size:14px;
    }

    .slot-status{
        font-size:12px;
    }

    .modal-content{
        margin:20px auto;
        padding:15px;
    }
}

/* ===== Compact Modern Calendar Header ===== */

.modern-calendar-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:12px 0 18px;
}

.calendar-title{
    text-align:center;
    flex:1;
}

.calendar-title h3{
    margin:0;
    font-size:18px;
    font-weight:700;
    color:#1f2937;
}

.calendar-title p{
    display:none;
}

/* Compact Buttons */
.calendar-nav{
    display:flex;
    align-items:center;
    gap:5px;
    padding:7px 10px;
    border-radius:10px;
    text-decoration:none;
    background:#fff;
    border:1px solid #e5e7eb;
    color:#2563eb;
    font-size:13px;
    font-weight:600;
    transition:all .25s ease;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.calendar-nav span{
    font-size:15px;
    transition:transform .25s ease;
}

.calendar-nav:hover{
    background:#2563eb;
    color:#fff;
    transform:translateY(-1px);
    box-shadow:0 5px 12px rgba(37,99,235,.25);
}

.calendar-nav.next:hover span{
    transform:translateX(2px);
}

.calendar-nav.prev:hover span{
    transform:translateX(-2px);
}

@media (max-width:768px){

    .calendar-title h3{
        font-size:16px;
    }

    .calendar-nav{
        padding:6px 8px;
        font-size:12px;
    }

    .calendar-nav span{
        font-size:14px;
    }

    .calendar-nav small{
        display:none;
    }
}

/* ===========================
   TIME SLOT MODAL
=========================== */

.selected-date{
    display:flex;
    align-items:center;
    gap:10px;
    background:#eff6ff;
    border:1px solid #bfdbfe;
    padding:12px;
    border-radius:12px;
    margin-bottom:18px;
    color:#1e3a8a;
    font-size:15px;
    font-weight:600;
}

.slot-label{
    margin-bottom:12px;
    color:#555;
    font-weight:600;
}

.slot-list{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
    gap:12px;
    max-height:320px;
    overflow-y:auto;
}

.slot-btn{
    padding:14px;
    border:none;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid #dbeafe;
    cursor:pointer;
    transition:.25s;
    font-weight:600;
}

.slot-btn:hover{
    background:#2563eb;
    color:#fff;
    transform:translateY(-2px);
}

.slot-btn.selected{
    background:#2563eb;
    color:#fff;
}

.slot-full{
    padding:14px;
    border-radius:12px;
    background:#f3f4f6;
    color:#9ca3af;
    text-align:center;
    font-weight:600;
}

/* =========================
   WEEKEND COLOR
========================= */

/* Saturday and Sunday */
.weekdays > div:nth-child(6),
.weekdays > div:nth-child(7) {
    color: #dc2626;
}

/* Weekend date numbers */
.calendar-grid .day:nth-child(7n),
.calendar-grid .day:nth-child(7n-1) {
    color: #dc2626;
}

/* Keep the button text red for disabled weekend dates */
.calendar-grid .day:nth-child(7n) button:disabled,
.calendar-grid .day:nth-child(7n-1) button:disabled {
    color: #dc2626;
}