/**
 * Cabin Booking Calendar — WooCommerce product availability calendar styles.
 *
 * Extracted from the inline <style> previously emitted by
 * display_availability_calendar(). Enqueued via frontend_scripts() with
 * CBC_VERSION.
 *
 * Per-booking day colours are applied at runtime by woo-frontend.js from each
 * booked cell's data-color attribute. The gradient on .cbc-gm-booked below is a
 * fallback so booked days remain legible even if scripts are blocked.
 *
 * @package CabinBooking
 * @version 5.1.0
 */

/* ── Product Page Availability Calendar ── */
.cbc-product-calendar {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cbc-cal-title {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 20px;
}

/* Navigation */
.cbc-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 8px 0;
}
.cbc-cal-prev,
.cbc-cal-next {
    background: #374151;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.cbc-cal-prev:hover,
.cbc-cal-next:hover {
    background: #1f2937;
}
.cbc-cal-current-month {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

/* Calendar grid (AJAX-loaded content) */
.cbc-cal-grid {
    transition: opacity 0.2s;
}
.cbc-gm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d1d5db;
    font-size: 13px;
}
.cbc-gm-table thead th {
    background: #f3f4f6;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #6b7280;
    border-bottom: 1px solid #d1d5db;
}
.cbc-gm-table thead th.cbc-gm-wkcol {
    background: #e5e7eb;
    color: #4b5563;
    width: 32px;
}
.cbc-gm-wknum {
    background: #fafafa;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    padding: 2px;
    border-right: 1px solid #e5e7eb;
}
.cbc-gm-day {
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}
.cbc-gm-day:last-child {
    border-right: none;
}
.cbc-gm-day:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cbc-gm-day.cbc-gm-available {
    background: #fff;
    color: #374151;
}
.cbc-gm-day.cbc-gm-available:hover {
    background: #f3f4f6;
}
.cbc-gm-day.cbc-gm-booked {
    /* Fallback background; woo-frontend.js overrides with the per-booking colour. */
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.cbc-gm-day.cbc-gm-booked:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.cbc-gm-day.cbc-gm-other {
    background: #fafafa;
    color: #d1d5db;
    cursor: default;
}
.cbc-gm-day.cbc-gm-other:hover {
    transform: none;
    box-shadow: none;
}
.cbc-gm-day.cbc-gm-today {
    border: 2px solid #2563eb;
    font-weight: 700;
}

/* Legend */
.cbc-cal-legend {
    margin-top: 15px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.cbc-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}
.cbc-cal-legend-box {
    width: 18px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid #d1d5db;
}
.cbc-cal-legend-available {
    background: #fff;
}
.cbc-cal-legend-booked {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

/* Contact Us CTA */
.cbc-cal-cta {
    margin-top: 20px;
    text-align: center;
}
.cbc-cal-contact-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}
.cbc-cal-contact-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Click Popup (shared style) */
.cbc-click-popup {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    z-index: 10000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    white-space: nowrap;
    cursor: pointer;
    animation: cbcPopupFadeIn 0.15s ease;
}
.cbc-click-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1f2937;
}
@keyframes cbcPopupFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 480px) {
    .cbc-product-calendar {
        padding: 15px;
    }
    .cbc-gm-day {
        padding: 6px 2px;
        font-size: 11px;
    }
    .cbc-cal-contact-btn {
        display: block;
        padding: 12px 20px;
    }
}
