/**
 * ScheduleRD — Public Stylesheet
 * Minimal, readable styles only. Override in your theme as needed.
 */

/* ── Utilities ────────────────────────────────────────────────────────────── */
.schedulerd-notice {
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 2px;
}

.schedulerd-notice--error {
    border-color: #cc1818;
    background: #fdf0f0;
}

.schedulerd-notice--success {
    border-color: #00a32a;
    background: #edfaef;
}

.schedulerd-notice ul {
    margin: 0;
    padding-left: 20px;
}

.schedulerd-placeholder {
    color: #777;
    font-style: italic;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.schedulerd-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.schedulerd-badge--current  { background: #d0f0dc; color: #1a6a35; }
.schedulerd-badge--expired  { background: #fdecea; color: #a10000; }
.schedulerd-badge--unknown  { background: #f0f0f0; color: #666;    }

.schedulerd-status--pending  { background: #fff3cd; color: #7a5c00; }
.schedulerd-status--approved { background: #d0f0dc; color: #1a6a35; }
.schedulerd-status--denied   { background: #fdecea; color: #a10000; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.schedulerd-dashboard { max-width: 760px; margin: 0 auto; }

.schedulerd-dashboard__title {
    font-size: 1.6em;
    margin-bottom: 24px;
}

.schedulerd-section {
    margin-bottom: 36px;
}

.schedulerd-section h3 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.schedulerd-qual-table,
.schedulerd-reservations-table {
    width: 100%;
    border-collapse: collapse;
}

.schedulerd-qual-table th,
.schedulerd-qual-table td,
.schedulerd-reservations-table th,
.schedulerd-reservations-table td {
    padding: 8px 12px;
    border: 1px solid #eee;
    text-align: left;
}

.schedulerd-qual-table th { width: 220px; background: #f9f9f9; }
.schedulerd-reservations-table th { background: #f9f9f9; }

/* ── Aircraft List ───────────────────────────────────────────────────────── */
.schedulerd-aircraft-list { max-width: 960px; margin: 0 auto; }

.schedulerd-aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.schedulerd-aircraft-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.schedulerd-aircraft-card__image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.schedulerd-aircraft-card__body {
    padding: 14px 16px;
}

.schedulerd-aircraft-card__title {
    font-size: 1.1em;
    margin: 0 0 8px;
}

/* ── Reservation Form ─────────────────────────────────────────────────────── */
.schedulerd-reservation-form-wrap { width: 100%; }

.schedulerd-form__field {
    margin-bottom: 18px;
}

.schedulerd-form__field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.schedulerd-form__field input[type="datetime-local"],
.schedulerd-form__field select,
.schedulerd-form__field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    box-sizing: border-box;
}

.schedulerd-form__field .required { color: #cc0000; }

.schedulerd-form__submit { margin-top: 24px; }

.schedulerd-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
}

.schedulerd-btn--primary {
    background: #2271b1;
    color: #fff;
}

.schedulerd-btn--primary:hover {
    background: #135e96;
}

/* ── Reservation Calendar ─────────────────────────────────────────────────── */
.schedulerd-calendar {
    font-size: 0.875em;
    border: 1px solid #3a3d40;
    border-radius: 4px;
    overflow: hidden;
    background: #2c2f33;
    color: #e0e0e0;
    margin-bottom: 24px;
}

/* Navigation bar */
.schedulerd-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #23272a;
    border-bottom: 1px solid #3a3d40;
}

.schedulerd-calendar__nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.schedulerd-calendar__date-label {
    font-weight: 700;
    font-size: 1em;
    color: #fff;
}

.schedulerd-calendar__nav-btn {
    color: #333;
    background: #fff;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.schedulerd-calendar__nav-btn:hover {
    background: #f0f0f0;
    color: #000;
    border-color: #999;
}

.schedulerd-calendar__today-btn {
    color: #333;
    background: #fff;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid #ccc;
    padding: 2px 10px;
    border-radius: 3px;
    transition: background 0.15s;
}

.schedulerd-calendar__today-btn:hover {
    background: #f0f0f0;
    color: #000;
}

/* Scroll wrapper */
.schedulerd-calendar__scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.schedulerd-calendar__inner {
    display: flex;
    flex-direction: column;
}

/* Header row */
.schedulerd-calendar__header-row {
    display: flex;
    background: #1e2124;
    border-bottom: 2px solid #3a3d40;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Aircraft data rows */
.schedulerd-calendar__aircraft-row {
    display: flex;
    border-bottom: 1px solid #3a3d40;
    min-height: 38px;
}

.schedulerd-calendar__aircraft-row:last-child {
    border-bottom: none;
}

.schedulerd-calendar__aircraft-row:hover {
    background: rgba(255,255,255,0.03);
}

/* Resource label (left column) */
.schedulerd-calendar__resource-label {
    padding: 6px 10px;
    border-right: 2px solid #444;
    font-size: 0.82em;
    font-weight: 600;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 0;
    background: inherit;
}

.schedulerd-calendar__resource-label--header {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

/* Time axis (header) */
.schedulerd-calendar__time-axis {
    display: flex;
    flex-shrink: 0;
}

.schedulerd-calendar__hour-label {
    flex: 0 0 auto;
    padding: 7px 4px;
    font-size: 0.78em;
    color: #888;
    border-right: 1px solid #333;
    box-sizing: border-box;
    text-align: left;
    white-space: nowrap;
}

/* Timeline (data rows, right column) */
.schedulerd-calendar__timeline {
    position: relative;
    flex: 1;
    height: 38px;
    flex-shrink: 0;
}

/* Hour grid cells */
.schedulerd-calendar__hour-cell {
    position: absolute;
    top: 0;
    bottom: 0;
    border-right: 1px solid #3a3d40;
    box-sizing: border-box;
    pointer-events: none;
}

/* Half-hour tick marks */
.schedulerd-calendar__half-mark {
    position: absolute;
    top: 60%;
    bottom: 0;
    width: 0;
    border-right: 1px dashed #333;
    pointer-events: none;
}

/* Empty state */
.schedulerd-calendar__empty {
    padding: 20px;
    color: #888;
    font-style: italic;
    text-align: center;
}

/* ── Reservation blocks ──────────────────────────────────────────────────── */
.schedulerd-res-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    cursor: default;
    z-index: 5;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Status colours — match the image style */
.schedulerd-res-block--pending   { background: #4a90e2; border-left: 3px solid #2563be; }
.schedulerd-res-block--approved  { background: #27ae60; border-left: 3px solid #1a7a43; }
.schedulerd-res-block--confirmed { background: #27ae60; border-left: 3px solid #1a7a43; }
.schedulerd-res-block--denied    { background: #cc1818; border-left: 3px solid #8b0000; }
.schedulerd-res-block--cancelled { background: #cc1818; border-left: 3px solid #8b0000; }

/* ── Clickable calendar (reservation form mode) ──────────────────────────── */
.schedulerd-calendar__timeline--clickable {
    cursor: crosshair;
}

.schedulerd-calendar--clickable .schedulerd-calendar__aircraft-row:hover {
    background: rgba(34, 113, 177, 0.1);
}

/* Calendar hint below the Gantt */
.schedulerd-cal-hint {
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.88em;
    margin: -12px 0 24px;
}

/* ── Reservation popover ──────────────────────────────────────────────────── */
.schedulerd-popover {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedulerd-popover__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.schedulerd-popover__box {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 24px 28px;
    width: 100%;
    max-width: 460px;
    margin: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    z-index: 1;
}

.schedulerd-popover__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.schedulerd-popover__title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1d2327;
}

.schedulerd-popover__close {
    background: none;
    border: none;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}

.schedulerd-popover__close:hover { color: #000; }

.schedulerd-popover__aircraft-name {
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 16px;
    font-size: 1em;
    min-height: 1.2em;
}

.schedulerd-popover__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.schedulerd-popover__cancel {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.schedulerd-popover__cancel:hover {
    background: #e0e0e0;
    color: #000;
}
