/**
 * Frontend Calendar CSS - Modern Airbnb-style Design
 * Responsive side-by-side layout with clean styling
 */

/* Reset and Base Styles */
.mbc-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #222;
    overflow: hidden; /* Prevent content overflow */
}

/* Main Layout - Side by Side */
.mbc-main-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

/* Calendar Section */
.mbc-calendar-section {
    background: white;
    min-width: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow */
}

.mbc-calendar-header h3 {
    font-size: 32px;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.mbc-calendar-subtitle {
    font-size: 16px;
    color: #717171;
    margin: 0 0 32px 0;
}

/* Calendar Navigation */
.mbc-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mbc-nav-prev,
.mbc-nav-next {
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #222;
}

.mbc-nav-prev:hover:not(:disabled),
.mbc-nav-next:hover:not(:disabled) {
    border-color: #222;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mbc-nav-prev:disabled,
.mbc-nav-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mbc-current-months {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

/* Calendar Grid - Side by Side Months */
.mbc-calendars-container {
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    width: 100%;
    max-width: 100%;
}

.mbc-months-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: none;
    width: 100%;
    max-width: 100%;
}

.mbc-calendar-month {
    padding: 32px;
    border: none;
    background: white;
    min-width: 0; /* Allow shrinking */
    max-width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
}

.mbc-calendar-month:first-child {
    border-right: 1px solid #ebebeb;
}

.mbc-month-header {
    text-align: center;
    margin-bottom: 24px;
    background: none;
    padding: 0;
    border: none;
}

.mbc-month-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

/* Calendar Grid */
.mbc-calendar-grid {
    padding: 0;
    width: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mbc-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px; /* Increased by 1px */
    margin-bottom: 8px;
    width: 100%;
}

.mbc-weekday {
    padding: 12px 0;
    text-align: center;
    font-size: 14px; /* Increased from 13px to 14px */
    font-weight: 600;
    color: #717171;
    text-transform: uppercase;
    min-width: 0;
    box-sizing: border-box;
}

.mbc-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0; /* 2px less than weekdays gap to account for smaller content */
    width: 100%;
    grid-template-rows: repeat(6, 1fr); /* Ensure 6 rows for consistent layout */
}

/* Calendar Days - Airbnb Style */
.mbc-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
    min-height: 40px;
    min-width: 40px;
    border-radius: 50%;
    margin: 1px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.mbc-day-number {
    font-size: 16px;
    font-weight: 500;
    position: relative;
    z-index: 2;
    line-height: 1;
}

.mbc-day-empty {
    cursor: default;
    visibility: hidden; /* Hide completely empty days from previous/next months */
}

.mbc-day-past {
    color: #ddd;
    cursor: not-allowed;
}

.mbc-day-past .mbc-day-number {
    text-decoration: line-through;
}

.mbc-day-available {
    color: #222;
}

.mbc-day-available:hover {
    background: #f7f7f7;
    border-radius: 50%;
}

.mbc-day-today {
    background: #222;
    color: white;
    font-weight: 600;
}

.mbc-day-booked {
    color: #ddd;
    cursor: not-allowed;
    position: relative;
}

.mbc-day-booked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #ddd;
    transform: translate(-50%, -50%) rotate(45deg);
}

.mbc-day-unavailable {
    color: #ddd;
    cursor: not-allowed;
    position: relative;
}

.mbc-day-unavailable .mbc-day-number {
    color: #ddd;
}

.mbc-day-unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 2px;
    height: 20px;
    background: #ddd;
}

.mbc-day-selected {
    background: #222;
    color: white;
    font-weight: 600;
}

.mbc-day-checkin {
    background: #222;
    color: white;
    border-radius: 50% 0 0 50%;
}

.mbc-day-checkout {
    background: #222;
    color: white;
    border-radius: 0 50% 50% 0;
}

.mbc-day-in-range {
    background: #f7f7f7;
    color: #222;
    border-radius: 0;
}

.mbc-day-hover-range {
    background: #ebebeb;
    color: #222;
    border-radius: 0;
}

.mbc-day-invalid-hint {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mbc-day-invalid-hint:hover {
    background: #fff3cd;
    border-color: #f39c12;
}

/* Form Section */
.mbc-form-section {
    position: sticky;
    top: 20px;
}

.mbc-form-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 24px;
    background: white;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.mbc-form-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    margin: 0 0 24px 0;
}

/* Date Fields */
.mbc-date-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.mbc-date-field {
    padding: 12px;
    border-right: 1px solid #ddd;
}

.mbc-date-field:last-child {
    border-right: none;
}

.mbc-date-field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mbc-date-input {
    border: none;
    background: none;
    font-size: 14px;
    color: #717171;
    width: 100%;
    outline: none;
    cursor: pointer;
}

.mbc-date-input:focus {
    color: #222;
}

/* Guests Field */
.mbc-guests-field {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.mbc-guests-field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mbc-guests-select {
    border: none;
    background: none;
    font-size: 14px;
    color: #222;
    width: 100%;
    outline: none;
    cursor: pointer;
}

/* Check Availability Button */
.mbc-check-availability {
    width: 100%;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 24px;
}

.mbc-check-availability:hover:not(:disabled) {
    background: #c2185b;
}

.mbc-check-availability:disabled {
    background: #ddd;
    cursor: not-allowed;
}

/* Guest Information Form */
.mbc-guest-info {
    border-top: 1px solid #ebebeb;
    padding-top: 24px;
}

.mbc-guest-info h4 {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0 0 16px 0;
}

.mbc-form-group {
    margin-bottom: 16px;
}

.mbc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.mbc-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
}

.mbc-form-group input,
.mbc-form-group textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: #222;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.mbc-form-group input:focus,
.mbc-form-group textarea:focus {
    outline: none;
    border-color: #222;
}

/* Submit Button */
.mbc-submit-booking {
    width: 100%;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 12px;
}

.mbc-submit-booking:hover {
    background: #c2185b;
}

.mbc-form-notice {
    text-align: center;
}

.mbc-form-notice p {
    margin: 0;
    color: #717171;
    font-size: 12px;
}

/* Selected Dates Display */
.mbc-selected-dates {
    background: #f7f7f7;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mbc-selection-summary {
    flex: 1;
}

.mbc-date-range {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}

.mbc-checkin-info,
.mbc-checkout-info {
    font-size: 14px;
}

.mbc-nights-info {
    font-size: 12px;
    color: #717171;
}

.mbc-clear-selection {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #222;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mbc-clear-selection:hover {
    border-color: #222;
}

/* Price Summary */
.mbc-price-summary {
    border: 1px solid #ebebeb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f9f9f9;
}

.mbc-price-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 12px 0;
}

.mbc-price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.mbc-price-total {
    border-top: 1px solid #ebebeb;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
}

/* Loading State */
.mbc-loading {
    text-align: center;
    padding: 40px;
    color: #717171;
}

/* Messages */
.mbc-messages {
    margin-top: 16px;
}

.mbc-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.mbc-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mbc-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mbc-main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .mbc-form-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .mbc-months-grid {
        grid-template-columns: 1fr;
    }
    
    .mbc-calendar-month:first-child {
        border-right: none;
        border-bottom: 1px solid #ebebeb;
    }
    
    .mbc-form-row {
        grid-template-columns: 1fr;
    }
    
    .mbc-date-fields {
        grid-template-columns: 1fr;
    }
    
    .mbc-date-field {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .mbc-date-field:last-child {
        border-bottom: none;
    }
    
    .mbc-date-range {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .mbc-frontend-container {
        padding: 12px;
    }
    
    .mbc-form-card {
        padding: 16px;
    }
    
    .mbc-calendar-month {
        padding: 16px;
    }
    
    .mbc-calendar-header h3 {
        font-size: 24px;
    }
    
    .mbc-selected-dates {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    /* Adjust calendar day size for mobile */
    .mbc-day {
        min-height: 40px;
        min-width: 40px;
        margin: 1px;
    }
    
    .mbc-day-number {
        font-size: 15px;
    }
    
    .mbc-weekday {
        padding: 8px 0;
        font-size: 12px;
    }
}

/* Focus and Accessibility */
.mbc-day:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.mbc-nav-prev:focus,
.mbc-nav-next:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mbc-day-available {
        border: 1px solid #222;
    }
    
    .mbc-day-booked {
        background: #000;
        color: #fff;
    }
    
    .mbc-day-selected {
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mbc-day,
    .mbc-nav-prev,
    .mbc-nav-next,
    .mbc-check-availability,
    .mbc-submit-booking {
        transition: none;
    }
    
    .mbc-day-available:hover {
        transform: none;
    }
} 