/* Modern Hijri Calendar Picker — Bootstrap 5 RTL Theme
   Replaces default Keith Wood styling for a premium look. */

/* ─── Container ─── */
.calendars {
    background: #fff;
    color: #212529;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    font-family: 'Inter', 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    overflow: hidden;
}
.calendars-rtl {
    direction: rtl;
}
.calendars-popup {
    z-index: 2000;
    position: absolute;
}
.calendars-disable {
    position: absolute;
    z-index: 100;
    background-color: white;
    opacity: 0.5;
}
.calendars a {
    color: inherit;
    text-decoration: none;
}
.calendars a.calendars-disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* ─── Top Nav (Prev / Today / Next) ─── */
.calendars-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
}
.calendars-cmd {
    width: auto;
}
a.calendars-cmd {
    display: inline-block;
    height: auto;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s;
    color: #fff;
}
a.calendars-cmd:hover {
    background: rgba(255,255,255,.2);
}
.calendars-cmd-prev, .calendars-cmd-prevJump, .calendars-cmd-clear {
    float: none;
    padding-left: 0;
}
.calendars-cmd-current, .calendars-cmd-today {
    float: none;
    width: auto;
    text-align: center;
}
.calendars-cmd-next, .calendars-cmd-nextJump, .calendars-cmd-close {
    float: none;
    padding-right: 0;
    text-align: right;
}
/* RTL overrides for commands */
.calendars-rtl .calendars-cmd-prev, .calendars-rtl .calendars-cmd-prevJump,
.calendars-rtl .calendars-cmd-clear {
    float: none;
    padding: 0;
}
.calendars-rtl .calendars-cmd-current, .calendars-rtl .calendars-cmd-today {
    float: none;
}
.calendars-rtl .calendars-cmd-next, .calendars-rtl .calendars-cmd-nextJump,
.calendars-rtl .calendars-cmd-close {
    float: none;
    padding: 0;
}

/* ─── Month Header (Month + Year dropdowns) ─── */
.calendars-month-header, .calendars-month-header select, .calendars-month-header input {
    height: auto;
    background: #f8f9fa;
    color: #212529;
    font-weight: 700;
    font-size: 14px;
}
.calendars-month-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
}
.calendars-month-header select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: #0d6efd;
    font-weight: 600;
    appearance: auto;
}
.calendars-month-header select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -1px;
}
.calendars-month-header input {
    position: absolute;
    display: none;
}

/* ─── Month Body ─── */
.calendars-month-row {
    clear: both;
}
.calendars-month {
    float: none;
    width: 100%;
    border: none;
    text-align: center;
    padding: 4px 10px 10px;
    box-sizing: border-box;
}
.calendars-month table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
}
.calendars-month thead {
    border-bottom: none;
}

/* ─── Day Headers (th) ─── */
.calendars-month th {
    background: #e9ecef;
    color: #6c757d;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 0;
    text-align: center;
    border: none;
    border-radius: 6px;
}
.calendars-month th a {
    background: transparent;
    color: #6c757d;
}
.calendars-month th.calendars-week {
    background: #e9ecef;
    color: #6c757d;
}

/* ─── Day Cells (td) ─── */
.calendars-month td {
    background: transparent;
    border: none;
    padding: 1px;
}
.calendars-month td.calendars-week {
    border: none;
}
.calendars-month td.calendars-week * {
    background: #e9ecef;
    color: #6c757d;
    border: none;
    border-radius: 6px;
}

/* ─── Day Links and Spans ─── */
.calendars-month a {
    display: block;
    width: auto;
    padding: 9px 0;
    background: transparent;
    color: #212529;
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s, color .15s, transform .15s;
    font-size: 14px;
    font-weight: 500;
}
.calendars-month a:hover {
    background: #e7f1ff;
    color: #0d6efd;
    transform: scale(1.05);
}
.calendars-month span {
    display: block;
    width: auto;
    padding: 9px 0;
    font-size: 14px;
}
.calendars-month td span {
    color: #ccc;
}

/* ─── Special Day States ─── */
.calendars-month td .calendars-other-month {
    background: transparent;
    color: #ccc;
}
.calendars-month td .calendars-weekend {
    background: transparent;
}
.calendars-month td .calendars-today {
    background: #fff3cd;
    color: #856404;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #ffc107;
}
.calendars-month td .calendars-highlight {
    background: #cfe2ff;
    border-radius: 8px;
}
.calendars-month td .calendars-selected {
    background: #0d6efd;
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* ─── Bottom Controls (Clear / Close) ─── */
.calendars-ctrl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    color: #495057;
    padding: 8px 14px;
    width: 100%;
    box-sizing: border-box;
    float: none;
    font-size: 13px;
    font-weight: 600;
    border-top: 1px solid #e9ecef;
}
.calendars-ctrl a.calendars-cmd {
    color: #495057;
}
.calendars-ctrl a.calendars-cmd:hover {
    background: #e9ecef;
    color: #dc3545;
}

/* ─── Status Bar ─── */
.calendars-status {
    clear: both;
    background: #f8f9fa;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    color: #6c757d;
}

/* ─── Clearfix ─── */
.calendars-clear-fix {
    clear: both;
}

/* ─── Multi-month (if used) ─── */
.calendars-multi .calendars-month {
    float: left;
}

/* ─── Responsive ─── */
@media (max-width: 576px) {
    .calendars {
        font-size: 13px;
        border-radius: 10px;
    }
    .calendars-popup {
        left: 5px !important;
        right: 5px !important;
        width: auto !important;
    }
    .calendars-month {
        padding: 2px 6px 6px;
    }
    .calendars-month a {
        padding: 7px 0;
        font-size: 13px;
    }
    .calendars-month th {
        font-size: 11px;
        padding: 6px 0;
    }
    .calendars-nav {
        padding: 8px 10px;
    }
    a.calendars-cmd {
        font-size: 12px;
        padding: 3px 7px;
    }
}
