/* Selden Barns Calendar Frontend Styles */

.selden-calendar-container {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

.selden-calendar-header {
    background: #821717;
    color: white;
    padding: 18px 20px;
    text-align: center;
}

.selden-calendar-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 5px 0;
    letter-spacing: 0.5px;
    color: white;
}

.selden-calendar-header p {
    font-size: 12px;
    margin: 0;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: white;
}

.selden-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

/* 12 Month Navigation */
.selden-month-nav-container {
    background: #821717;
    padding: 12px 20px 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.selden-month-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.selden-current-year {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.selden-year-nav {
    display: flex;
    gap: 8px;
}

.selden-year-nav-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
}

.selden-year-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.selden-month-nav-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
}

.selden-month-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 3px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.selden-month-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.selden-month-nav-btn.selden-month-active {
    background: white;
    color: #821717;
    border-color: white;
    font-weight: 700;
}

.selden-month-nav-btn.selden-month-current {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border-color: #FFD700;
}

.selden-month-nav-btn.selden-month-disabled,
.selden-month-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.selden-month-display {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    color: #821717;
}

.selden-calendar-nav {
    display: flex;
    gap: 8px;
}

.selden-nav-button {
    background: white;
    border: 1px solid #821717;
    color: #821717;
    padding: 6px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
}

.selden-nav-button:hover:not(:disabled) {
    background: #821717;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(130, 23, 23, 0.3);
}

.selden-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.selden-calendar-grid {
    padding: 15px 18px;
}

.selden-weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.selden-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 10px;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selden-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.selden-day-cell {
    aspect-ratio: 1;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
    overflow: visible;
}

.selden-day-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.selden-day-number {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.selden-day-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
}

/* Availability Status Colors */
.selden-available {
    border-color: #4CAF50;
}

.selden-available .selden-day-indicator {
    background: #4CAF50;
}

.selden-available:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.selden-booked {
    border-color: #e74c3c;
    background: #fef5f5;
    cursor: not-allowed;
}

.selden-booked .selden-day-indicator {
    background: #e74c3c;
}

.selden-booked:hover {
    transform: none;
    box-shadow: none;
}

.selden-tentative {
    border-color: #FFA726;
}

.selden-tentative .selden-day-indicator {
    background: #FFA726;
}

.selden-tentative:hover {
    border-color: #FFA726;
    background: #fff8f0;
}

.selden-blocked {
    border-color: #9e9e9e;
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.selden-blocked .selden-day-indicator {
    background: #9e9e9e;
}

.selden-blocked:hover {
    transform: none;
    box-shadow: none;
}

.selden-past {
    border-color: #ddd;
    background: #f9f9f9;
    cursor: default;
    opacity: 0.5;
}

.selden-past:hover {
    transform: none;
    box-shadow: none;
}

.selden-empty-day {
    border: none;
    cursor: default;
}

.selden-empty-day:hover {
    transform: none;
    box-shadow: none;
}

/* Price Tooltip on Hover - Hidden by Default */
.selden-price-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #821717;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    font-weight: 500;
}

.selden-price-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #821717;
}

/* Desktop: Show on hover */
.selden-day-cell:hover .selden-price-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Mobile: Show when class is added via JavaScript */
.selden-price-tooltip.selden-mobile-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(-4px) !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    display: block !important;
}

.selden-price-amount {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    color: white;
}

.selden-price-label {
    font-size: 9px;
    opacity: 0.9;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: white;
}

/* Status Badge */
.selden-status-badge {
    font-size: 7px;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 3px;
}

.selden-available .selden-status-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.selden-booked .selden-status-badge {
    background: #ffebee;
    color: #c62828;
}

.selden-tentative .selden-status-badge {
    background: #fff3e0;
    color: #ef6c00;
}

.selden-blocked .selden-status-badge {
    background: #f5f5f5;
    color: #616161;
}

/* Premium Saturday Badge */
.selden-premium-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Legend */
.selden-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.selden-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

.selden-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Enquiry Section */
.selden-enquiry-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.selden-enquiry-button {
    background: #821717;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(130, 23, 23, 0.3);
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
}

.selden-enquiry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(130, 23, 23, 0.4);
    background: #6b1313;
}

/* Modal Styles */
.selden-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.selden-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.selden-modal-close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.selden-modal-close:hover,
.selden-modal-close:focus {
    color: #000;
}

.selden-modal-content h2 {
    font-family: 'Playfair Display', serif;
    color: #821717;
    margin-bottom: 8px;
    font-size: 22px;
}

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

.selden-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.selden-form-group input,
.selden-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    box-sizing: border-box;
}

.selden-form-group textarea {
    resize: vertical;
}

.selden-enquiry-submit {
    background: #821717;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(130, 23, 23, 0.3);
    font-family: 'Montserrat', sans-serif;
    width: 100%;
}

.selden-enquiry-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(130, 23, 23, 0.4);
    background: #6b1313;
}

#selden-enquiry-success {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .selden-calendar-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        overflow-x: hidden;
    }

    .selden-calendar-header {
        padding: 10px 8px;
    }

    .selden-calendar-header h1 {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .selden-calendar-header p {
        font-size: 9px;
    }

    .selden-month-nav-container {
        padding: 8px 8px 10px 8px;
    }

    .selden-month-nav-header {
        flex-direction: column;
        gap: 6px;
    }

    .selden-current-year {
        font-size: 14px;
    }

    .selden-month-nav-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
    }

    .selden-month-nav-btn {
        padding: 4px 2px;
        font-size: 8px;
        border-radius: 3px;
        border-width: 1px;
    }

    .selden-year-nav {
        width: 100%;
        justify-content: space-between;
    }

    .selden-year-nav-btn {
        flex: 1;
        padding: 4px 8px;
        font-size: 9px;
        border-width: 1px;
    }

    .selden-calendar-controls {
        flex-direction: column;
        gap: 8px;
        padding: 8px 8px;
    }

    .selden-month-display {
        font-size: 16px;
    }

    .selden-calendar-nav {
        gap: 4px;
        width: 100%;
        justify-content: space-between;
    }

    .selden-nav-button {
        padding: 4px 8px;
        font-size: 10px;
        flex: 1;
        border-width: 1px;
    }

    /* CRITICAL: Calendar grid must fit 7 columns on mobile */
    .selden-calendar-grid {
        padding: 8px 4px;
        overflow-x: hidden;
    }

    .selden-weekday-header {
        gap: 2px;
        margin-bottom: 2px;
    }

    .selden-weekday {
        font-size: 8px;
        padding: 4px 0;
        letter-spacing: 0;
        overflow: hidden;
        text-overflow: clip;
    }

    .selden-days-grid {
        gap: 2px;
        width: 100%;
    }

    .selden-day-cell {
        padding: 3px 1px;
        border-radius: 3px;
        border-width: 1px;
        min-width: 0;
        width: 100%;
        overflow: visible;
    }

    .selden-day-number {
        font-size: 10px;
        line-height: 1;
    }

    .selden-day-indicator {
        width: 4px;
        height: 4px;
        margin-top: 2px;
    }

    .selden-status-badge {
        font-size: 5px;
        padding: 1px 2px;
        margin-top: 1px;
        letter-spacing: 0;
    }

    .selden-premium-badge {
        font-size: 5px;
        padding: 1px 2px;
        top: 2px;
        right: 2px;
    }

    .selden-price-tooltip {
        font-size: 9px;
        padding: 5px 8px;
        border-radius: 4px;
    }

    .selden-price-tooltip::after {
        border-width: 4px;
    }

    /* Ensure mobile tooltips stay visible when tapped */
    .selden-price-tooltip.selden-mobile-visible {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 9999 !important;
        display: block !important;
        transform: translateX(-50%) translateY(-4px) !important;
    }

    .selden-price-amount {
        font-size: 11px;
    }

    .selden-price-label {
        font-size: 7px;
    }

    .selden-calendar-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .selden-legend-item {
        font-size: 9px;
        gap: 4px;
    }

    .selden-legend-dot {
        width: 8px;
        height: 8px;
    }

    .selden-enquiry-section {
        padding: 12px;
    }

    .selden-enquiry-button {
        padding: 8px 20px;
        font-size: 11px;
    }
    
    .selden-modal-content {
        margin: 5% 2%;
        padding: 18px 12px;
        width: 96%;
        max-width: none;
    }

    .selden-modal-content h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .selden-modal-close {
        font-size: 22px;
    }

    .selden-form-group {
        margin-bottom: 10px;
    }

    .selden-form-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .selden-form-group input,
    .selden-form-group textarea {
        font-size: 11px;
        padding: 6px;
    }

    .selden-enquiry-submit {
        font-size: 12px;
        padding: 8px 20px;
    }
}

/* Extra small phones - ensure 7 columns always fit */
@media (max-width: 375px) {
    .selden-calendar-grid {
        padding: 6px 2px;
    }

    .selden-weekday-header {
        gap: 1px;
    }

    .selden-days-grid {
        gap: 1px;
    }

    .selden-day-cell {
        padding: 2px 0;
        border-width: 0.5px;
    }

    .selden-day-number {
        font-size: 9px;
    }

    .selden-weekday {
        font-size: 7px;
        padding: 3px 0;
    }

    .selden-status-badge {
        font-size: 4px;
        padding: 1px;
    }

    .selden-day-indicator {
        width: 3px;
        height: 3px;
    }
}
