/* ==========================================================================
   Outdoor Scheduler — Frontend Styles
   ========================================================================== */

/* ── App wrapper ─────────────────────────────────────────────────────────── */
#ods-app {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Calendar loading overlay ────────────────────────────────────────────── */
#ods-calendar-wrap {
    position: relative;
    min-height: 380px;
}

#ods-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 5;
    font-size: .9rem;
    color: #555;
    border-radius: 6px;
}

/* Spinner */
.ods-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #ddd;
    border-top-color: #3d8b3d;
    border-radius: 50%;
    animation: ods-spin .75s linear infinite;
}
@keyframes ods-spin { to { transform: rotate(360deg); } }

/* ── Day cell status colours ─────────────────────────────────────────────── */
/* FullCalendar's background events handle the main colour fill.
   These classes add hover effects and a fallback tint. */

.fc .ods-day--available { cursor: pointer; }
.fc .ods-day--available .fc-daygrid-day-frame {
    background: rgba(61,139,61,.14);
    transition: background .15s;
}
.fc .ods-day--available:hover .fc-daygrid-day-frame {
    background: rgba(61,139,61,.28);
}

.fc .ods-day--weather_hold .fc-daygrid-day-frame {
    background: rgba(224,140,0,.14);
}

.fc .ods-day--busy .fc-daygrid-day-frame {
    background: rgba(180,180,180,.15);
    opacity: .75;
}

.fc .ods-day--unknown .fc-daygrid-day-frame {
    background: rgba(160,160,160,.10);
}

/* ── Legend ──────────────────────────────────────────────────────────────── */
#ods-legend {
    list-style: none;
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: .85rem;
    color: #555;
}

#ods-legend li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ods-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ods-dot--available { background: rgba(61,139,61,.45);  border: 1px solid #3d8b3d; }
.ods-dot--weather   { background: rgba(224,140,0,.45);  border: 1px solid #e08c00; }
.ods-dot--busy      { background: rgba(180,180,180,.55);border: 1px solid #bbb;    }

/* ── Modal backdrop ──────────────────────────────────────────────────────── */
#ods-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ods-fade .15s ease;
}
@keyframes ods-fade { from { opacity:0; } to { opacity:1; } }

/* ── Modal panel ─────────────────────────────────────────────────────────── */
#ods-modal-panel {
    background: #fff;
    border-radius: 10px;
    padding: 32px 36px 28px;
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
    position: relative;
    animation: ods-rise .18s ease;
}
@keyframes ods-rise {
    from { transform: translateY(14px); opacity:.5; }
    to   { transform: translateY(0);    opacity:1;  }
}

/* Close ✕ */
.ods-close-btn {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.ods-close-btn:hover { background: #f5f5f5; color: #333; }

/* Chosen date */
.ods-chosen-date {
    font-size: 1rem;
    font-weight: 700;
    color: #3d8b3d;
    margin: 4px 0 20px;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.ods-field {
    margin-bottom: 16px;
}

.ods-field label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

.ods-req   { color: #c0392b; }
.ods-optional { font-weight: 400; color: #999; font-size: .8em; }

.ods-field input,
.ods-field textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: .95rem;
    font-family: inherit;
    color: #333;
    box-sizing: border-box;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.ods-field input:focus,
.ods-field textarea:focus {
    outline: none;
    border-color: #3d8b3d;
    box-shadow: 0 0 0 3px rgba(61,139,61,.18);
}
.ods-field input[aria-invalid="true"],
.ods-field textarea[aria-invalid="true"] {
    border-color: #e53e3e;
}

.ods-err {
    display: block;
    color: #c0392b;
    font-size: .8rem;
    margin-top: 4px;
    min-height: 1em;
}

.ods-privacy {
    font-size: .78rem;
    color: #999;
    margin: 2px 0 18px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ods-form-actions {
    display: flex;
    gap: 10px;
}

.ods-btn {
    padding: 11px 22px;
    border-radius: 6px;
    font-size: .95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .08s;
    border: 1.5px solid transparent;
}
.ods-btn--primary {
    flex: 1;
    background: #3d8b3d;
    color: #fff;
    border-color: #3d8b3d;
}
.ods-btn--primary:hover:not(:disabled) { background: #336b33; }
.ods-btn--primary:active:not(:disabled){ transform: scale(.98); }
.ods-btn--primary:disabled             { background: #8ec08e; cursor: not-allowed; }

.ods-btn--secondary {
    background: #fff;
    color: #555;
    border-color: #d1d5db;
}
.ods-btn--secondary:hover { border-color: #999; background: #f9f9f9; }

/* ── Form status message ─────────────────────────────────────────────────── */
#ods-form-msg {
    margin-top: 12px;
    font-size: .875rem;
    min-height: 1em;
    border-radius: 5px;
}
#ods-form-msg.ods-msg--error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 9px 14px;
}

/* ── Success view ────────────────────────────────────────────────────────── */
#ods-success-view {
    text-align: center;
    padding: 10px 0;
}
.ods-success-icon {
    width: 64px; height: 64px;
    background: #3d8b3d;
    color: #fff;
    font-size: 2rem;
    line-height: 64px;
    border-radius: 50%;
    margin: 0 auto 20px;
}
#ods-success-view h2 { margin: 0 0 12px; }
#ods-success-view p  { color: #555; margin-bottom: 24px; line-height: 1.6; }
#ods-success-view .ods-btn--primary { flex: none; width: auto; padding: 10px 36px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    #ods-modal { align-items: flex-end; padding: 0; }
    #ods-modal-panel {
        border-radius: 14px 14px 0 0;
        padding: 24px 18px 28px;
        max-width: 100%;
    }
    .ods-form-actions { flex-direction: column; }
    .ods-btn--secondary { order: 2; }
}
