/* ===================================================
   GLOBAL RESET
=================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #3b3a3d;
    line-height: 1.6;
    overflow-x: hidden;
}

h2 {
    text-align: center;
}

/* ===================================================
   COLOR SYSTEM
=================================================== */
:root {
    --brand-orange: #fbad17;
    --brand-orange-soft: #fff4db;
    --brand-orange-light: #ffd978;
    --brand-orange-dark: #d8920f;

    --accent-green: #18503b;
    --accent-green-soft: #edf7f2;

    --brand-dark: #3b3a3d;
    --text-main: #2f2e33;
    --text-muted: #727179;

    --bg-page: #f8f9fb;
    --bg-card: #ffffff;
    --border-soft: #e8e8ea;

    --danger: #ef4444;
    --danger-soft: #fee2e2;
}

/* ===================================================
   CALENDAR WRAPPER
=================================================== */
.calendar-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(59, 58, 61, 0.06);
    margin: 25px auto;
    max-width: 520px;
}

/* ===================================================
   CALENDAR HEADER
=================================================== */
.calendar-header {
    background: linear-gradient(
        135deg,
        #ffe7a8 0%,
        #fbad17 70%
    );

    color: #ffffff;
    padding: 14px 18px;
    border-radius: 16px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 22px;

    box-shadow: 0 6px 16px rgba(251, 173, 23, 0.18);
}

.calendar-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.calendar-header button {
    background: linear-gradient(
        135deg,
        #ffd978,
        #fbad17
    );
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;

    width: 40px;
    height: 40px;
    border-radius: 12px;

    font-size: 18px;
    font-weight: 800;
    cursor: pointer;

    transition: 0.2s ease;
}

.calendar-header button:hover {
    background: rgba(255,255,255,0.4);
}

/* ===================================================
   CALENDAR GRID
=================================================== */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.day-header {
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 13px;
    text-transform: uppercase;
}

/* ===================================================
   BASE DAY STYLE
=================================================== */
.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-page);
    color: var(--brand-dark);
    border: 1px solid transparent;
    min-height: 42px;
    transition: all 0.2s ease;
}

.day:hover {
    background: var(--brand-orange-soft);
    border-color: #ffe0a3;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(251, 173, 23, 0.15);
}

.day.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

/* ===================================================
   DAY STATES
=================================================== */
.day.today {
    border: 2px solid var(--brand-orange);
    background: var(--brand-orange-soft);
    color: var(--brand-orange-dark);
    font-weight: 800;
}

.day.selected {
    background: linear-gradient(135deg, #ffd978, #fbad17);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(251, 173, 23, 0.25);
    font-weight: 800;
    border-color: var(--brand-orange);
}

/* FULL SLOT */
.day.full {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
    cursor: not-allowed;
}

.day.full:hover {
    transform: none;
    box-shadow: none;
}

/* HOLIDAY & CLOSED */
.day.holiday,
.day.closed {
    background: repeating-linear-gradient(
        45deg,
        #f3f4f6,
        #f3f4f6 4px,
        #e5e7eb 4px,
        #e5e7eb 8px
    );
    border: 1px solid #9ca3af;
    color: #6b7280;

    cursor: not-allowed;
}

.day.holiday:hover,
.day.closed:hover {
    transform: none;
    box-shadow: none;
}

/* PAST DATE */
.day.past-date {
    /* beda jelas dari normal & closed/holiday */
    background: linear-gradient(180deg, #fafafa, #f1f1f1);
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    opacity: 0.7;
    cursor: not-allowed;
    font-weight: 500;
}

/* UMROH LIMIT */
.day.umroh-limit {
    background: #f3f4f6;
    color: #a3a3a3;
    border: 1px solid #eeeeee;
    cursor: not-allowed;
}

/* ===================================================
   SELECTED DATE INFO
=================================================== */
.selected-date {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-left: 5px solid var(--brand-orange);
    color: var(--brand-dark);
    padding: 15px;
    border-radius: 14px;
    margin: 20px auto 0;
    text-align: center;
    font-size: 14px;
    max-width: 520px;
    box-shadow: 0 8px 22px rgba(59, 58, 61, 0.05);
}

.selected-date strong {
    font-weight: 800;
    color: var(--accent-green);
}

#dateDisplay.selected-date {
    background:
        radial-gradient(circle at top left, rgba(255,217,120,0.35), transparent 40%),
        linear-gradient(135deg, #ffffff 0%, #fff4db 100%);
    
    border: none;
    border: 1px solid var(--border-soft);
    box-shadow: 0 8px 22px rgba(59, 58, 61, 0.06);
    border-radius: 18px;
    padding: 18px 22px;
    text-align: center;

    font-size: 15px;


}

#dateDisplay.selected-date strong {
    color: var(--accent-green);
    font-weight: 800;
}

/* ===================================================
   TIME SLOTS
=================================================== */
.time-slots {
    margin: 25px auto 0;
    max-width: 520px;
}

.time-slots h3 {
    font-size: 17px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--brand-dark);
    font-weight: 800;
}

.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
}

.time-slot {
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.time-slot:hover {
    background: var(--brand-orange-soft);
    border-color: var(--brand-orange);
    transform: translateY(-1px);
}

.time-slot.selected {
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-dark));
    color: #ffffff;
    border-color: var(--brand-orange);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(251, 173, 23, 0.28);
}

.time-slot.full {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
    cursor: not-allowed;
}

.time-slot.full[onclick] {
    cursor: pointer;
}

.time-slot.admin-booked {
    border-color: var(--brand-orange);
    background: var(--brand-orange-soft);
    color: var(--brand-dark);
}

.time-slot.full.selected {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
    outline: 2px solid var(--brand-orange);
    outline-offset: 2px;
}

.time-slot.admin-past {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

/* ===================================================
   LEGEND
=================================================== */
.legend {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--brand-dark);
    font-weight: 600;
}

.legend-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
}

.legend-box.tersedia {
    background: var(--bg-page);
}

.legend-box.penuh {
    background: var(--danger-soft);
    border-color: #fecaca;
}

.legend-box.closed,
.legend-box.holiday {
    background: repeating-linear-gradient(
        45deg,
        #f3f4f6,
        #f3f4f6 4px,
        #e5e7eb 4px,
        #e5e7eb 8px
    );
    border: 1px solid #9ca3af;
}

/* ===================================================
   RESPONSIVE
=================================================== */
@media (max-width: 768px) {
    .calendar-wrapper {
        padding: 15px;
        max-width: 100%;
    }

    .day {
        font-size: 13px;
        min-height: 38px;
    }
}

@media (max-width: 480px) {
    .day {
        font-size: 12px;
        min-height: 35px;
    }

    .calendar-header h2 {
        font-size: 14px;
    }

    .calendar-header button {
        padding: 5px 11px;
        font-size: 16px;
    }
}
