/**
 * 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: #374151;
    color: #fff !important;
}

.schedulerd-btn--primary:hover {
    background: #1f2937;
    color: #fff !important;
}

/* ── 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;
}

/* ── CFI Availability (calendar) ─────────────────────────────────────────── */

/* Section separator between aircraft rows and CFI rows */
.schedulerd-calendar__section-divider {
    display: flex;
    align-items: center;
    background: #1e2124;
    border-top: 2px solid #3a3d40;
    border-bottom: 1px solid #3a3d40;
    padding: 0;
    min-height: 26px;
}

.schedulerd-calendar__section-label {
    flex: 0 0 auto;
    padding: 4px 10px;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #4ecdc4;
    border-right: 2px solid #444;
}

.schedulerd-calendar__section-line {
    flex: 1;
    height: 0;
    border-top: 1px dashed #333;
    margin: 0 10px;
}

/* CFI rows (same structure as aircraft rows, teal accent) */
.schedulerd-calendar__cfi-row {
    display: flex;
    border-bottom: 1px solid #3a3d40;
    min-height: 38px;
}

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

.schedulerd-calendar__cfi-row:hover {
    background: rgba(78,205,196,0.04);
}

/* CFI availability blocks */
.schedulerd-cfi-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 0.78em;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    cursor: default;
    z-index: 5;
    box-sizing: border-box;
    background: #16a085;
    border-left: 3px solid #0d7070;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    opacity: 0.9;
}

.schedulerd-cfi-block:hover {
    opacity: 1;
}

/* ── Inspection Form ──────────────────────────────────────────────────────── */

.schedulerd-inspection-wrap {
    max-width: 760px;
    margin: 0 auto;
    font-size: .95rem;
}

.schedulerd-inspection-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Open-squawks banner */
.schedulerd-squawks-open {
    background: #fff8e1;
    border: 1px solid #f9a825;
    border-radius: 4px;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}
.schedulerd-squawks-open h4 {
    margin: 0 0 .5rem;
    color: #b45309;
    font-size: 1rem;
}
.schedulerd-squawks-list {
    list-style: none;
    padding: 0;
    margin: 0 0 .75rem;
}
.schedulerd-squawks-list li {
    padding: .25rem 0;
    border-bottom: 1px solid #fde68a;
    font-size: .9rem;
}
.schedulerd-squawk-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    margin: .25rem .25rem 0 0;
    vertical-align: top;
}
.schedulerd-ack-label {
    display: block;
    margin-top: .5rem;
    font-weight: 600;
    cursor: pointer;
}
.schedulerd-ack-label input[type="checkbox"] {
    margin-right: .4rem;
}
.schedulerd-squawks-clear {
    background: #e8f5e9;
    border: 1px solid #66bb6a;
    border-radius: 4px;
    padding: .6rem 1rem;
    margin-bottom: 1.25rem;
    color: #2e7d32;
    font-weight: 600;
}

/* Form body */
.schedulerd-inspection-form .schedulerd-field-row {
    margin-bottom: 1rem;
}
.schedulerd-inspection-form label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
}
.schedulerd-inspection-form input[type="text"],
.schedulerd-inspection-form textarea,
.schedulerd-inspection-form select {
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: .93rem;
    box-sizing: border-box;
}
.schedulerd-inspection-form textarea {
    min-height: 80px;
    resize: vertical;
}
.schedulerd-field-row--inline {
    display: flex;
    gap: 1rem;
}
.schedulerd-field-row--inline .schedulerd-field-half {
    flex: 1;
}

/* Issue rows */
.schedulerd-issues-section h4 {
    font-size: 1rem;
    margin-bottom: .5rem;
}
.schedulerd-issue-row {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: .75rem;
    margin-bottom: .75rem;
    background: #fafafa;
}
.schedulerd-issue-row .schedulerd-issue-meta {
    display: flex;
    gap: .75rem;
    margin-bottom: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.schedulerd-issue-row select {
    width: auto !important;
    min-width: 140px;
}
.schedulerd-issue-row input[type="file"] {
    font-size: .85rem;
}
.schedulerd-remove-issue {
    margin-left: auto;
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
}
.schedulerd-remove-issue:hover { color: #991b1b; }
.schedulerd-add-issue-btn {
    background: none;
    border: 1px dashed #6b7280;
    color: #374151;
    padding: .4rem .8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
    margin-bottom: 1rem;
}
.schedulerd-add-issue-btn:hover { background: #f3f4f6; }

/* Done / flash messages */
.schedulerd-inspection-done {
    background: #e8f5e9;
    border: 1px solid #66bb6a;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    color: #1b5e20;
    margin-bottom: 1.25rem;
}
.schedulerd-inspection-error {
    background: #fef2f2;
    border: 1px solid #f87171;
    border-radius: 4px;
    padding: .75rem 1rem;
    color: #b91c1c;
    margin-bottom: 1rem;
}

/* ── Current aircraft times display (post-flight form) ───────────────────── */
.schedulerd-current-times {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.schedulerd-times-heading {
    margin: 0 0 .75rem;
    font-size: 1rem;
    color: #374151;
}
.schedulerd-current-time-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.schedulerd-current-time-display {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 200px;
}
.schedulerd-current-time-label {
    font-weight: 600;
    color: #374151;
    font-size: .93rem;
}
.schedulerd-current-time-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1d4ed8;
    min-width: 60px;
}
.schedulerd-times-incorrect-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    color: #6b7280;
    cursor: pointer;
}
.schedulerd-times-incorrect-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.schedulerd-corrected-time-wrap {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
}
.schedulerd-corrected-time-wrap label {
    font-weight: 600;
    color: #dc2626;
    margin-bottom: .3rem;
}
.schedulerd-correction-note {
    margin: .4rem 0 0;
    font-size: .82rem;
    color: #9ca3af;
    font-style: italic;
}

/* Submit button wrapper */
.schedulerd-inspection-submit {
    margin-top: 1.5rem;
}
/* The actual submit input */
.schedulerd-submit-btn {
    background: #374151 !important;
    color: #fff !important;
    border: none !important;
    padding: .6rem 1.4rem !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    font-weight: 600 !important;
}
.schedulerd-submit-btn:hover {
    background: #1f2937 !important;
    color: #fff !important;
}

/* Dashboard inspection links */
.schedulerd-inspection-links {
    white-space: nowrap;
}
.schedulerd-insp-link {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 3px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: .25rem;
}
.schedulerd-insp-link--pre  { background: #374151; color: #fff !important; }
.schedulerd-insp-link--post { background: #374151; color: #fff !important; }
.schedulerd-insp-link--pre:hover  { background: #1f2937; color: #fff !important; }
.schedulerd-insp-link--post:hover { background: #1f2937; color: #fff !important; }
.schedulerd-insp-na { color: #9ca3af; }

/* ── Action Required panel ──────────────────────────────────────────────── */
.schedulerd-action-required {
    border: 2px solid #f97316;
    border-radius: 6px;
    background: #fff7ed;
    padding: 1rem 1.25rem;
}
.schedulerd-action-required__title {
    color: #c2410c;
    margin: 0 0 .75rem;
    font-size: 1.1rem;
}
.schedulerd-action-group {
    margin-top: 1rem;
}
.schedulerd-action-group h4 {
    margin: 0 0 .3rem;
    font-size: .95rem;
    color: #374151;
}
.schedulerd-action-group__desc {
    font-size: .875rem;
    color: #6b7280;
    margin: 0 0 .5rem;
}
.schedulerd-action-list {
    list-style: disc;
    padding-left: 1.4rem;
    margin: 0;
}
.schedulerd-action-item {
    font-size: .9rem;
    margin-bottom: .35rem;
}
.schedulerd-action-item--overdue {
    color: #b91c1c;
}
.schedulerd-action-item__link {
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
}
.schedulerd-action-item__link:hover {
    text-decoration: underline;
}

/* ── Action Required — inspection buttons ───────────────────────────────── */
.schedulerd-action-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.schedulerd-action-item__info {
    flex: 1;
    min-width: 0;
}
.schedulerd-action-btn {
    display: inline-block;
    padding: .45rem 1rem;
    border-radius: 5px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.schedulerd-action-btn--preflight {
    background: #374151;
    color: #fff !important;
}
.schedulerd-action-btn--preflight:hover  { background: #1f2937; color: #fff !important; }
.schedulerd-action-btn--postflight {
    background: #374151;
    color: #fff !important;
}
.schedulerd-action-btn--postflight:hover { background: #1f2937; color: #fff !important; }

/* ── Reservation table — Actions column ─────────────────────────────────── */
.schedulerd-res-actions {
    white-space: nowrap;
}
.schedulerd-cancel-form {
    display: inline;
}
.schedulerd-res-btn {
    display: inline-block;
    padding: .35rem .8rem;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1.4;
    vertical-align: middle;
}
.schedulerd-res-btn--cancel {
    background: #374151;
    color: #fff !important;
    margin-right: .35rem;
}
.schedulerd-res-btn--cancel:hover { background: #1f2937; color: #fff !important; }
.schedulerd-res-btn--reschedule {
    background: #374151;
    color: #fff !important;
}
.schedulerd-res-btn--reschedule:hover { background: #1f2937; color: #fff !important; }
.schedulerd-res-actions__past { color: #9ca3af; }

/* ── Status badge — cancelled ───────────────────────────────────────────── */
.schedulerd-status--cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Dashboard flash notice ─────────────────────────────────────────────── */
.schedulerd-notice {
    padding: .75rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: .925rem;
    font-weight: 500;
}
.schedulerd-notice--success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ── "Schedule a flight" empty-state button ─────────────────────────────── */
.schedulerd-action-btn--schedule {
    display: inline-block;
    margin-top: .5rem;
    padding: .6rem 1.4rem;
    background: #374151;
    color: #fff;
    border-radius: 5px;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
}
.schedulerd-action-btn--schedule { color: #fff !important; }
.schedulerd-action-btn--schedule:hover { background: #1f2937; color: #fff !important; }
