/* --- SCOPED CSS --- */
.on-booking-system {
    font-family: 'Montserrat', sans-serif;
    --on-blue: #0061ff;
    --on-dark: #111111;
    --on-gray: #1f1f1f;
    --on-text: #ffffff;
    --on-muted: #888888;
    --on-border: #333333;
    /* Reset some common WP theme conflicts */
    box-sizing: border-box;
}

.on-booking-system *,
.on-booking-system *::before,
.on-booking-system *::after {
    box-sizing: inherit;
}

/* 1. DER TRIGGER BUTTON */
.on-trigger-btn {
    background-color: var(--on-blue);
    color: var(--on-text);
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    cursor: pointer;
    transform: skewX(-10deg);
    transition: transform 0.2s, background 0.3s;
    display: inline-block;
    text-decoration: none;
}

.on-trigger-btn span {
    display: block;
    transform: skewX(10deg);
    /* Text gerade rücken */
}

.on-trigger-btn:hover {
    background-color: #004ecc;
    transform: skewX(-10deg) scale(1.05);
}

/* 2. DAS MODAL OVERLAY */
.on-modal-overlay {
    display: none;
    /* Standardmäßig versteckt */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Dunkler Dimmer */
    backdrop-filter: blur(5px);
    z-index: 99999;
    /* Use block or flex column for scrolling content */
    display: none;
    flex-direction: column;
    align-items: center;
    /* Fixes full width issue */
    overflow-y: auto;
    /* The overlay itself scrolls */
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

/* Prevent body scroll when modal is open */
html.on-modal-open,
body.on-modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.on-modal-overlay.is-open {
    display: flex;
    opacity: 1;
}

/* 3. DER MODAL INHALT */
.on-modal-content {
    box-sizing: border-box;
    background-color: var(--on-gray);
    width: 95%;
    max-width: 500px;
    /* Remove fixed height to allow overlay scrolling */
    margin: 40px auto;
    /* Center naturally in flow */
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    color: var(--on-text);
}

.on-modal-overlay.is-open .on-modal-content {
    transform: translateY(0);
}

/* Close Button (X) */
.on-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--on-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
}

.on-close-btn:hover {
    color: var(--on-blue);
}

/* --- FORM STYLES --- */
.on-booking-system h3 {
    text-transform: uppercase;
    font-weight: 800;
    font-style: italic;
    margin: 0 0 20px 0;
    color: var(--on-text);
    font-size: 1.5rem;
    line-height: 1.2;
}

.on-booking-system h3 span {
    color: var(--on-blue);
}

.on-form-group {
    margin-bottom: 15px;
}

.on-form-group label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--on-muted);
    margin-bottom: 5px;
    font-weight: 700;
}

.on-input {
    width: 100%;
    background: var(--on-dark);
    border: 1px solid var(--on-border);
    padding: 12px;
    color: #fff;
    font-size: 1rem;
    border-radius: 0;
    font-family: inherit;
    transition: border-color 0.2s;
}

.on-input:focus {
    outline: none;
    border-color: var(--on-blue);
}

/* Select styling */
select.on-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

/* Calendar Styling */
.on-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--on-dark);
    padding: 10px;
    border: 1px solid var(--on-border);
    margin-bottom: 10px;
}

.on-cal-btn {
    background: none;
    border: none;
    color: var(--on-blue);
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
    padding: 5px 10px;
}

.on-month-label {
    font-weight: 700;
    text-transform: uppercase;
    color: var(--on-text);
}

.on-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.on-day-name {
    font-size: 0.7rem;
    color: var(--on-muted);
    text-align: center;
    text-transform: uppercase;
}

.on-day {
    background: var(--on-dark);
    border: 1px solid var(--on-border);
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    color: var(--on-text);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.on-day:hover:not(.empty):not(.disabled) {
    border-color: var(--on-blue);
}

.on-day.selected {
    background: var(--on-blue);
    border-color: var(--on-blue);
    color: #fff;
}

.on-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.on-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Time Slots */
.on-time-section {
    display: none;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

.on-time-section.active {
    display: block;
}

.on-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.on-time-slot {
    background: var(--on-dark);
    border: 1px solid var(--on-border);
    padding: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--on-text);
}

.on-time-slot:hover:not(.disabled) {
    border-color: var(--on-blue);
}

.on-time-slot.selected {
    background: var(--on-blue);
    border-color: var(--on-blue);
}

.on-time-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Submit Button */
.on-submit-btn {
    width: 100%;
    background: var(--on-blue);
    color: #fff;
    border: none;
    padding: 15px;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    cursor: pointer;
    transform: skewX(-10deg);
    margin-top: 20px;
    transition: background 0.3s;
}

.on-submit-btn span {
    display: block;
    transform: skewX(10deg);
}

.on-submit-btn:hover {
    background: #004ecc;
}

.on-submit-btn:disabled {
    background: var(--on-muted);
    cursor: not-allowed;
}

/* Feedback Messages */
.on-success-msg {
    color: #00ff88;
}

.on-error-msg {
    color: #ff3333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#statusResult {
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--on-text);
    text-align: center;
}

#onTrackingIdInput {
    text-transform: uppercase;
}

/* Success Modal - Explicit styling for when moved to body */
#onSuccessModalOverlay {
    --on-blue: #0061ff;
    --on-gray: #1f1f1f;
    --on-text: #ffffff;
    --on-muted: #888888;
    font-family: 'Montserrat', sans-serif;
}

#onSuccessModalOverlay .on-modal-content {
    background-color: #1f1f1f;
    padding: 40px 30px;
    border-radius: 8px;
    color: #ffffff;
}

#onSuccessModalOverlay h3 {
    text-transform: uppercase;
    font-weight: 800;
    font-style: italic;
    margin: 0 0 10px 0;
    color: #ffffff;
    font-size: 1.5rem;
}

/* Fix IOs Zoom on Input Focus */
@media screen and (max-width: 768px) {

    .on-input,
    .on-booking-system input,
    .on-booking-system select,
    .on-booking-system textarea {
        font-size: 16px !important;
    }
}