/**
 * Ferientraum Schollbrunn - Buchungskalender Styles
 */

/* ======================================
   Booking System Container
   ====================================== */

.booking-system {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Page-specific frame */
.booking-shell {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    padding: 18px;
    border: 1px solid #eee;
}

.nojs-box {
    background:#fff5e5;
    padding:20px;
    border-radius:8px;
    text-align:center;
    margin-top:20px;
    border:1px solid #ffd7a6;
}

/* ======================================
   Apartment Selector
   ====================================== */

.apartment-selector {
    margin-bottom: 30px;
}

.apartment-selector h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
}

.apartment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.apartment-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.apartment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.apartment-card.selected {
    border-color: #352c25;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.25);
}

.apartment-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.apartment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apartment-stars {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: gold;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.apartment-info {
    padding: 15px;
}

.apartment-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.15rem;
}

.apartment-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.apartment-price {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
}

.price-unit {
    color: #000000;
    font-size: 0.9rem;
}

/* ======================================
   Calendar Section
   ====================================== */

.calendar-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calendar-title {
    margin: 0;
    font-size: 1.2rem;
    color: #000000;
}

.cal-nav {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.cal-nav:hover {
    background: #413c39;
    color: #fff;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-dot.available {
    background: #e8f5e9;
    border: 1px solid #00ff08;
}

.legend-dot.booked {
    background: #ff1900;
    border: 1px solid #c0392b;
}

.legend-dot.checkout-day {
    background: linear-gradient(135deg, #ff1900 50%, #00ff6a 50%);
    border: 1px solid #c0392b;
}

.legend-dot.selected {
    background: #2d3436;
}

/* ======================================
   Calendar Grid
   ====================================== */

.calendars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.calendar-month {
    background: #e4e9ee;
    border-radius: 10px;
    padding: 15px;
}

.month-header {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: #000000;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: #000000;
    margin-bottom: 8px;
    font-weight: 500;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: #f6fff7;
    border: 1px solid #c8e6c9;
    color: #000000;
    position: relative;
    overflow: hidden;
}

.cal-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.cal-day.disabled,
.cal-day.past {
    color: #ccc;
    background: #f5f5f5;
    cursor: not-allowed;
    border-color: #eee;
}

/* Belegte Tage - kräftiges Rot */
.cal-day.booked {
    background: #ff0400ab;
    color: #fff;
    cursor: not-allowed;
    border-color: #ff00009d;
    font-weight: 500;
}

/* Abreisetag - schräge Rot/Grün Markierung (buchbar!) */
.cal-day.checkout-day,
.cal-day.checkout-day.available {
    background: linear-gradient(135deg, #ff0400 50%, #0adc5ad5 50%) !important;
    color: #fff;
    border-color: #888;
    cursor: pointer;
    font-weight: 500;
}

.cal-day.checkout-day:hover,
.cal-day.checkout-day.available:hover {
    background: linear-gradient(135deg, #ff0400 50%, #0adc5ad5 50%) !important;
    border-color: #000000;
}

/* Manuelle Sperren - Rot */
.cal-day.blocked {
    background: #ff0000a8;
    color: #fff;
    cursor: not-allowed;
    border-color: #343333d5;
}

.cal-day.available {
    background: #0adc5ad5;
    border-color: #343333d5;
    color: #000000;
}

.cal-day:not(.disabled):not(.booked):not(.blocked):not(.empty):hover {
    background: #635b4f;
    border-color: #000;
}

/* Ausgewählte Tage - Anthrazit  */
.cal-day.selected {
    background: #37474f;
    color: #fff;
    border-color: #263238;
    font-weight: 600;
}

/* Bereich zwischen An- und Abreise - helles Anthrazit */
.cal-day.in-range {
    background: #78909c;
    color: #fff;
    border-color: #546e7a;
}

.cal-day.check-in::after,
.cal-day.check-out::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

/* ======================================
   Selection Summary
   ====================================== */

.selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.selection-summary.warning {
    background: linear-gradient(135deg, #002df5 0%, #0008ff 100%);
}

.summary-dates {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.summary-date {
    text-align: center;
}

.summary-date label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.summary-date span {
    font-weight: 600;
    font-size: 1rem;
}

.summary-arrow {
    font-size: 1.2rem;
    opacity: 0.7;
}

.summary-nights {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-book {
    background: #fff;
    color: #37474f;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-book:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-book:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ======================================
   Booking Modal
   ====================================== */

.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.booking-modal.open {
    opacity: 1;
    visibility: visible;
}

.booking-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.booking-modal-content > h3 {
    position: sticky;
    top: 0;
    background: #000000;
    color: #fff;
    margin: 0;
    padding: 20px 50px 20px 25px;
    font-size: 1.3rem;
    border-radius: 16px 16px 0 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* ======================================
   Form Styles
   ====================================== */

#booking-form {
    padding: 25px;
}

.form-section {
    margin-bottom: 25px;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7b7a79;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ======================================
   Booking Summary Box
   ====================================== */

.booking-summary-box {
    background: #ececec;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #000000;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span {
    color: #000000;
}

.summary-row strong {
    color: #333;
}

/* ======================================
   Extras List
   ====================================== */

.extras-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.extra-item:hover {
    background: #f0f0f0;
}

.extra-item input {
    width: 20px;
    height: 20px;
    accent-color: #000000;
}

.extra-info {
    flex: 1;
}

.extra-name {
    display: block;
    font-weight: 500;
    color: #333;
}

.extra-desc {
    font-size: 0.85rem;
    color: #888;
}

.extra-price {
    font-weight: 600;
    color: #000000;
    white-space: nowrap;
}

/* ======================================
   Price Calculation
   ====================================== */

.price-calculation {
    background: #ececec;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.price-calculation h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}

.price-row.total {
    border-top: 2px solid #000000;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #000000;
}

/* ======================================
   Form Actions
   ====================================== */

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-secondary,
.btn-primary {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #000000;
    color: #fff;
}

.btn-primary:hover {
    background: #000000;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ======================================
   Success Message
   ====================================== */

.booking-success {
    padding: 50px 30px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
}

.booking-success h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.booking-success p {
    color: #666;
    line-height: 1.6;
}

.success-details {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

/* ======================================
   Responsive Design
   ====================================== */

@media (max-width: 768px) {
    .booking-system {
        padding: 10px;
    }

    .apartment-cards {
        grid-template-columns: 1fr;
    }

    .apartment-image {
        height: 150px;
    }

    .calendars-grid {
        grid-template-columns: 1fr;
    }

    .selection-summary {
        flex-direction: column;
        text-align: center;
    }

    .summary-dates {
        justify-content: center;
    }

    .btn-book {
        width: 100%;
    }

    .booking-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .booking-modal-content > h3 {
        border-radius: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .cal-day {
        font-size: 0.8rem;
    }

    .weekdays span {
        font-size: 0.7rem;
    }
}

/* Checkbox Label */
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; color: #333; }
.checkbox-label input { width: 20px; height: 20px; accent-color: #8B4513; }
