/*
 * Statische Stile für die Seite "Neue Reservierung" im Admin-Bereich.
 * Dynamische Farbwerte werden per wp_add_inline_style() in PHP hinzugefügt.
 */

/* Deaktivierte Tage (nicht auswählbar) - Basiszustand von jQuery UI */
.ui-datepicker .ui-state-disabled .ui-state-default {
    opacity: 0.7 !important;
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border: 1px solid #ddd !important;
}

/* Ausgeschlossene Tage (Feiertage/Schließtage aus Einstellungen) */
.ui-datepicker .ausgeschlossener-tag .ui-state-default,
.ui-datepicker .ausgeschlossener-tag span { /* Span wird verwendet, wenn der Tag nicht klickbar ist */
    background-color: #ffdddd !important;
    color: #ff0000 !important;
    text-decoration: line-through !important;
    border-color: #ffc0c0 !important;
    opacity: 1 !important; /* Volle Opazität, um die Farbe klar zu zeigen */
}

/* Deaktivierte Wochentage (z.B. Ruhetage aus Einstellungen) */
.ui-datepicker .deaktivierter-wochentag .ui-state-default,
.ui-datepicker .deaktivierter-wochentag span {
    background-color: #f0f0f0 !important;
    color: #999 !important;
    text-decoration: line-through !important;
    border-color: #e0e0e0 !important;
    opacity: 1 !important;
}

/* Datepicker allgemeines Styling */
div.ui-datepicker {
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Von formular.php für konsistenten Schatten */
    z-index: 1000 !important;
    width: 80% !important; /* Von formular.php */
    max-width: 300px;      /* Von formular.php */
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important; /* Kein Innenabstand für den Hauptcontainer des Datepickers */
    background-color: #ffffff !important; /* White background for the datepicker container */
    border: 1px solid #ddd !important; /* Border for the datepicker container */
}

/* jQuery UI Datepicker Header Anpassungen */
.ui-datepicker-header {
    background: var(--reservierung-container-bg) !important;
    color: var( --reservierung-text-color) !important;
    border-radius: 4px 4px 0 0;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 5px !important; /* Etwas Padding für den Header */
    border-bottom: 1px solid var(--reservierung-button-color);
}
   /* Styling for disabled days (td has .ui-state-disabled) */
    .ui-datepicker-calendar td.ui-state-disabled span.ui-state-default,
    .ui-datepicker-calendar td.ui-state-disabled a.ui-state-default {
        background-color: var(--reservierung-tile-bg, #f5f5f5) !important;
        color: rgba(0,0,0,0.5) !important;
        opacity: 0.7 !important;
        border-color: rgba(0,0,0,0.1) !important;
        cursor: not-allowed !important;
    }
.ui-datepicker-prev {
    order: 1;
    flex-shrink: 0;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background-color: var(--reservierung-button-color) !important;
    border: none !important;
    cursor: pointer;
    margin-left: 5px !important;
    padding: 0 !important;
    width: 28px !important;
    height: 27px !important;
    border-radius: 4px !important;
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ui-datepicker-title {
    order: 2;
    flex-grow: 1;
    text-align: center !important;
    margin: 0 0.5em !important;
    line-height: 1.8em !important;
    font-weight: bold;
}

.ui-datepicker-next {
    order: 3;
    flex-shrink: 0;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background-color: var(--reservierung-button-color) !important;
    border: none !important;
    cursor: pointer;
    margin-right: 5px !important;
    padding: 0 !important;
    width: 28px !important;
    height: 27px !important;
    border-radius: 4px !important;
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: block;
    position: relative !important;
    left: auto !important;
    margin-left: 0 !important;
    top: auto !important;
    margin-top: 0 !important;
}

.ui-datepicker-prev .ui-icon,
.ui-datepicker-next .ui-icon {
    background-image: none !important;
    text-indent: -9999px !important;
    overflow: hidden;
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.ui-datepicker-prev .ui-icon::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FFFFFF'%3E%3Cpath d='M11.043 1.561a.75.75 0 00-1.061 0L4.779 6.764a.75.75 0 000 1.06L9.982 13.03a.75.75 0 101.06-1.061L6.37 7.294l4.673-4.673a.75.75 0 000-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

.ui-datepicker-next .ui-icon::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FFFFFF'%3E%3Cpath d='M5.018 1.561a.75.75 0 011.061 0l5.203 5.203a.75.75 0 010 1.06l-5.203 5.203a.75.75 0 11-1.06-1.061L9.63 7.294 5.018 2.622a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

.ui-datepicker-calendar {
    width: 100%;
    border-collapse: collapse;
    margin: 0; /* Kein Margin für die Tabelle selbst */
}

.ui-datepicker-calendar th {
    background-color: #f7f7f7 !important; /* Heller Hintergrund für Wochentage-Header */
    color: #333 !important;
    padding: 5px 2px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    text-align: center;
    font-weight: bold;
}

/* Gemeinsame Stile für alle Tageszellen */
.ui-datepicker-calendar td {
    padding: 1px !important; /* Minimales Padding um die Zellen für den Rand-Effekt */
    border: none; /* Kein direkter Rand an der Zelle, der Rand ist am Link/Span */
}

.ui-datepicker-calendar td a.ui-state-default,
.ui-datepicker-calendar td span.ui-state-default { /* Span für nicht klickbare Tage */
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    text-align: center !important;
    text-decoration: none !important;
    padding: 5px 2px !important;
    font-size: 13px !important; /* Etwas kleiner für Admin */
    line-height: 1.4em !important;
    border-radius: 3px !important; /* Kleinere Rundung */
    border: 1px solid #ddd !important;
    color: #333 !important; /* Standard-Textfarbe für Admin */
    background: #fdfdfd !important; /* Sehr heller Hintergrund für Tage */
    opacity: 1.0 !important;
}

/* Hover-Effekt für verfügbare Tage */
.ui-datepicker-calendar td a.ui-state-hover {
    background: #e0f7ff !important; /* Heller Admin-Blau-Hover */
    border-color: #99d1ff !important;
    color: #004a7c !important;
}

/* Styling für "heute" */
.ui-datepicker-calendar td.ui-datepicker-today a.ui-state-default,
.ui-datepicker-calendar td.ui-datepicker-today span.ui-state-default {
    background: #fffadd !important;
    border-color: #fcefae !important;
    color: #363636 !important;
    font-weight: bold;
}

/* Styling für ausgewählten Tag */
.ui-datepicker-calendar td.ui-datepicker-current-day a.ui-state-default,
.ui-datepicker-calendar td.ui-datepicker-current-day span.ui-state-default {
    background: #2271b1 !important; /* Admin-Blau für Auswahl */
    color: #ffffff !important;
    border-color: #135e96 !important; /* Dunkleres Admin-Blau für Rand */
    font-weight: bold;
}


/* Responsiv für Admin-Bereich */
@media (max-width: 782px) { /* WordPress Admin Breakpoint */
    div.ui-datepicker {
        width: 90% !important;
        max-width: none; /* Erlaube volle Breite auf schmalen Admin-Screens */
        background-color: #ffffff !important; /* White background for the datepicker container */
        border: 1px solid #ddd !important; /* Border for the datepicker container */
    }

    .ui-datepicker-calendar th {
        padding: 3px 1px !important;
        font-size: 11px !important;
    }

    .ui-datepicker-calendar td a.ui-state-default,
    .ui-datepicker-calendar td span.ui-state-default {
        font-size: 12px !important;
        padding: 4px 1px !important;
    }
}

/* ---- Two-column layout: Form + Hint tile ---- */
.mrtr-reservierung-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    flex-wrap: wrap;
}

.mrtr-reservierung-layout > form {
    flex: 0 0 auto;
    min-width: 0;
}

/* ---- Admin Hint Tile ---- */
.mrtr-admin-hinweis-tile {
    flex: 1 1 280px;
    max-width: 420px;
    margin-top: 20px;
    background: #fffef5;
    border: 1px solid #e8c83a;
    border-left: 5px solid #e8a800;
    border-radius: 6px;
    padding: 18px 20px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 13px;
    color: #3c3c3c;
    position: sticky;
    top: 32px;
    align-self: flex-start;
    display: none;
}

.mrtr-hinweis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mrtr-hinweis-icon {
    font-size: 22px;
    color: #e8a800;
    line-height: 1;
    flex-shrink: 0;
}

.mrtr-admin-hinweis-tile h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #7a5700;
    line-height: 1.3;
}

.mrtr-hinweis-intro {
    margin: 0 0 12px;
    color: #555;
    line-height: 1.5;
}

.mrtr-hinweis-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mrtr-hinweis-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.45;
    padding-bottom: 9px;
    border-bottom: 1px solid #f0e8bb;
}

.mrtr-hinweis-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mrtr-hinweis-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 3px;
    align-self: flex-start;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.mrtr-hinweis-badge--warn {
    background: #fde8c8;
    color: #7a3a00;
    border: 1px solid #f5c07a;
}

.mrtr-hinweis-badge--info {
    background: #dceeff;
    color: #0a3d6b;
    border: 1px solid #a3c8f0;
}

.mrtr-hinweis-badge--ok {
    background: #e0f5e9;
    color: #1a5c35;
    border: 1px solid #8ed4a8;
}

@media (max-width: 900px) {
    .mrtr-reservierung-layout {
        flex-direction: column;
    }
    .mrtr-admin-hinweis-tile {
        max-width: 100%;
        position: static;
    }
}

/* ---- Dwell Time Toggle ---- */
.mrtr-toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}

.mrtr-toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mrtr-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #c3c4c7;
    border-radius: 12px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.mrtr-toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mrtr-toggle-text {
    font-weight: 500;
    color: #1d2327;
    font-size: 13px;
}

.mrtr-duration-hint {
    margin-top: 8px !important;
    color: #646970;
    font-style: italic;
}

.mrtr-custom-duration-box {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f0f6fc;
    border: 1px solid #c3d4e5;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.mrtr-custom-duration-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
}

.mrtr-custom-duration-box input[type="number"] {
    width: 80px;
}

/* ---- Guests Combo-box (number input + preset dropdown) ---- */
.mrtr-personen-combobox {
    display: inline-flex;
    align-items: stretch;
}

.mrtr-personen-input {
    width: 80px;
    border-radius: 4px 0 0 4px !important;
    border-right: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}
.mrtr-personen-input::-webkit-outer-spin-button,
.mrtr-personen-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mrtr-personen-preset {
    border-radius: 0 4px 4px 0 !important;
    border-left: 1px solid #8c8f94 !important;
    background: #f6f7f7;
    cursor: pointer;
    padding: 0 4px;
    font-size: 13px;
    height: 30px;
    min-width: 36px;
}

/* ---- Pro lock badge for number input ---- */
.mrtr-pro-lock-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(232, 168, 0, 0.18);
    border: 1px solid #e8a800;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: not-allowed;
    z-index: 1;
}