/* =========================================
   GLOBAL CALENDAR FONT & INNER TWEAKS
   ========================================= */
/* Force Month and Year to be aggressively Bold */
.flatpickr-calendar .flatpickr-month,
.flatpickr-calendar .flatpickr-current-month {
    font-weight: 900 !important;
}
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-current-month input.cur-year {
    font-weight: 900 !important;
    font-size: 1.15em !important;
    color: inherit !important; 
}
.flatpickr-calendar .flatpickr-weekday { 
    font-weight: 800 !important; 
}

/* The Inner Calendar (White Card with Shadow) */
.flatpickr-calendar.inline {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e9ecef !important;
    padding: 10px 0 !important; /* 0 horizontal padding saves space on mobile */
    width: 100% !important;
    max-width: 320px !important;
    min-width: 250px !important; 
    margin: 0 auto !important;
    overflow: hidden !important; 
}

/* =========================================
   MOBILE GRID FIX (Fixes the 8-Days-in-a-Row Bug)
   ========================================= */
.flatpickr-innerContainer, 
.flatpickr-rContainer, 
.flatpickr-days {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Forces exactly 7 columns mathematically so days never shift */
.flatpickr-weekdaycontainer,
.dayContainer {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    justify-items: center !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

.flatpickr-weekday {
    width: 100% !important;
}

.flatpickr-day {
    width: 38px !important; 
    max-width: 38px !important; 
    height: 38px !important; 
    line-height: 38px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 2px 0 !important; 
}

/* The Outer Wrapper */
#calendar-theme-wrapper { 
    border-radius: 16px; 
    border: 1px solid transparent; 
    padding: 20px !important; 
    transition: all 0.3s ease; 
}

/* =========================================
   CALENDAR DOT COLORS & BOOKED STAMP
   ========================================= */
   
/* 1. Pending Bookings (Soft Blue) */
.flatpickr-day.booked-unpaid, .flatpickr-day.booked-pending {
    background-color: #9bc8ff !important;
    border-color: #9bc8ff !important;
    color: #000000 !important;
    position: relative;
    overflow: visible !important;
    border-radius: 50% !important;
}

/* 2. Paid Bookings (Grey) */
.flatpickr-day.booked-paid {
    background-color: #808080 !important;
    border-color: #808080 !important;
    color: #ffffff !important;
    position: relative;
    overflow: visible !important;
    border-radius: 50% !important;
}

/* 3. The "BOOKED" Stamp */
.flatpickr-day.booked-paid::after, .flatpickr-day.booked-unpaid::after, .flatpickr-day.booked-pending::after {
    content: "BOOKED";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg) scale(0.60); 
    color: #d9534f;
    font-weight: 900;
    font-size: 10px; 
    background: white;
    border: 2px solid #d9534f;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
    z-index: 5;
    white-space: nowrap;
    pointer-events: none; 
}

/* Grey out legitimately disabled calendar dates */
.flatpickr-day.flatpickr-disabled {
    color: #d1d5db !important;
}

/* =========================================
   YOUR ORIGINAL THEMES (0, 1, and 2)
   ========================================= */

/* Theme 0: Original Blue */
.theme-0 #calendar-theme-wrapper { background-color: #f4f9fd !important; border-radius: 12px; border: 2px solid #cce5ff; box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1); }
.theme-0 .flatpickr-current-month { color: #0056b3 !important; font-weight: bold; }
.theme-0 .flatpickr-weekday { color: #007bff !important; font-weight: bold; }
.title-theme-0 { color: #0056b3 !important; }
.theme-0 .flatpickr-day.selected, .theme-0 .flatpickr-day.startRange, .theme-0 .flatpickr-day.endRange { background: #0d6efd !important; border-color: #0d6efd !important; color: #fff !important; }
.theme-0 .flatpickr-day.inRange { background: #e6f0ff !important; border-color: #e6f0ff !important; box-shadow: -5px 0 0 #e6f0ff, 5px 0 0 #e6f0ff !important; }

/* Theme 1: Original Green (Dashed Border) */
.theme-1 #calendar-theme-wrapper { background-color: #f6fcf6 !important; border-radius: 20px; border: 2px dashed #c3e6cb; }
.theme-1 .flatpickr-current-month { color: #155724 !important; font-family: 'Courier New', Courier, monospace; }
.theme-1 .flatpickr-weekday { color: #28a745 !important; font-style: italic; font-weight: bold;}
.title-theme-1 { color: #155724 !important; }
.theme-1 .flatpickr-day.selected, .theme-1 .flatpickr-day.startRange, .theme-1 .flatpickr-day.endRange { background: #198754 !important; border-color: #198754 !important; color: #fff !important; }
.theme-1 .flatpickr-day.inRange { background: #e8f5e9 !important; border-color: #e8f5e9 !important; box-shadow: -5px 0 0 #e8f5e9, 5px 0 0 #e8f5e9 !important; }

/* Theme 2: Original Yellow (Square Edges) */
.theme-2 #calendar-theme-wrapper { background-color: #fffaf0 !important; border-radius: 0px; border: 3px solid #ffeeba; }
.theme-2 .flatpickr-current-month { color: #856404 !important; text-transform: uppercase; }
.theme-2 .flatpickr-weekday { color: #ffc107 !important; font-weight: bold;}
.title-theme-2 { color: #856404 !important; }
.theme-2 .flatpickr-day.selected, .theme-2 .flatpickr-day.startRange, .theme-2 .flatpickr-day.endRange { background: #ffc107 !important; border-color: #ffc107 !important; color: #000 !important; }
.theme-2 .flatpickr-day.inRange { background: #fff3cd !important; border-color: #fff3cd !important; box-shadow: -5px 0 0 #fff3cd, 5px 0 0 #fff3cd !important; }

/* =========================================
   ADDITIONAL THEMES (3-20)
   ========================================= */

/* Theme 3: Deep Purple */
.theme-3 #calendar-theme-wrapper { background-color: #f4effa !important; border: 1px solid #e0d4f5 !important; }
.theme-3 .flatpickr-current-month, .theme-3 .flatpickr-weekday, .title-theme-3 { color: #512da8 !important; font-weight: bold;}
.theme-3 .flatpickr-day.selected, .theme-3 .flatpickr-day.startRange, .theme-3 .flatpickr-day.endRange { background: #512da8 !important; border-color: #512da8 !important; color: #fff !important; }
.theme-3 .flatpickr-day.inRange { background: #ece7f6 !important; border-color: #ece7f6 !important; box-shadow: -5px 0 0 #ece7f6, 5px 0 0 #ece7f6 !important; }

/* Theme 4: Red */
.theme-4 #calendar-theme-wrapper { background-color: #fdf3f4 !important; border: 1px solid #f5c2c7 !important; }
.theme-4 .flatpickr-current-month, .theme-4 .flatpickr-weekday, .title-theme-4 { color: #dc3545 !important; font-weight: bold;}
.theme-4 .flatpickr-day.selected, .theme-4 .flatpickr-day.startRange, .theme-4 .flatpickr-day.endRange { background: #dc3545 !important; border-color: #dc3545 !important; color: #fff !important; }
.theme-4 .flatpickr-day.inRange { background: #fbebec !important; border-color: #fbebec !important; box-shadow: -5px 0 0 #fbebec, 5px 0 0 #fbebec !important; }

/* Theme 5: Teal */
.theme-5 #calendar-theme-wrapper { background-color: #f0fdf9 !important; border: 1px solid #bcead9 !important; }
.theme-5 .flatpickr-current-month, .theme-5 .flatpickr-weekday, .title-theme-5 { color: #20c997 !important; font-weight: bold;}
.theme-5 .flatpickr-day.selected, .theme-5 .flatpickr-day.startRange, .theme-5 .flatpickr-day.endRange { background: #20c997 !important; border-color: #20c997 !important; color: #fff !important; }
.theme-5 .flatpickr-day.inRange { background: #e6f9f3 !important; border-color: #e6f9f3 !important; box-shadow: -5px 0 0 #e6f9f3, 5px 0 0 #e6f9f3 !important; }

/* Theme 6: Pink */
.theme-6 #calendar-theme-wrapper { background-color: #fdf1f6 !important; border: 1px solid #f8c9df !important; }
.theme-6 .flatpickr-current-month, .theme-6 .flatpickr-weekday, .title-theme-6 { color: #e83e8c !important; font-weight: bold;}
.theme-6 .flatpickr-day.selected, .theme-6 .flatpickr-day.startRange, .theme-6 .flatpickr-day.endRange { background: #e83e8c !important; border-color: #e83e8c !important; color: #fff !important; }
.theme-6 .flatpickr-day.inRange { background: #fce8f1 !important; border-color: #fce8f1 !important; box-shadow: -5px 0 0 #fce8f1, 5px 0 0 #fce8f1 !important; }

/* Theme 7: Cyan */
.theme-7 #calendar-theme-wrapper { background-color: #f0fbcc !important; border: 1px solid #b6effb !important; }
.theme-7 .flatpickr-current-month, .theme-7 .flatpickr-weekday, .title-theme-7 { color: #0dcaf0 !important; font-weight: bold;}
.theme-7 .flatpickr-day.selected, .theme-7 .flatpickr-day.startRange, .theme-7 .flatpickr-day.endRange { background: #0dcaf0 !important; border-color: #0dcaf0 !important; color: #fff !important; }
.theme-7 .flatpickr-day.inRange { background: #e6f9fc !important; border-color: #e6f9fc !important; box-shadow: -5px 0 0 #e6f9fc, 5px 0 0 #e6f9fc !important; }

/* Theme 8: Indigo */
.theme-8 #calendar-theme-wrapper { background-color: #f5f0ff !important; border: 1px solid #d2b9ff !important; }
.theme-8 .flatpickr-current-month, .theme-8 .flatpickr-weekday, .title-theme-8 { color: #6610f2 !important; font-weight: bold;}
.theme-8 .flatpickr-day.selected, .theme-8 .flatpickr-day.startRange, .theme-8 .flatpickr-day.endRange { background: #6610f2 !important; border-color: #6610f2 !important; color: #fff !important; }
.theme-8 .flatpickr-day.inRange { background: #f0e6ff !important; border-color: #f0e6ff !important; box-shadow: -5px 0 0 #f0e6ff, 5px 0 0 #f0e6ff !important; }

/* Theme 9: Brown */
.theme-9 #calendar-theme-wrapper { background-color: #f6f4f3 !important; border: 1px solid #d6c8c4 !important; }
.theme-9 .flatpickr-current-month, .theme-9 .flatpickr-weekday, .title-theme-9 { color: #795548 !important; font-weight: bold;}
.theme-9 .flatpickr-day.selected, .theme-9 .flatpickr-day.startRange, .theme-9 .flatpickr-day.endRange { background: #795548 !important; border-color: #795548 !important; color: #fff !important; }
.theme-9 .flatpickr-day.inRange { background: #f2ece9 !important; border-color: #f2ece9 !important; box-shadow: -5px 0 0 #f2ece9, 5px 0 0 #f2ece9 !important; }

/* Theme 10: Dark Teal */
.theme-10 #calendar-theme-wrapper { background-color: #e6f5f4 !important; border: 1px solid #b3e0dc !important; }
.theme-10 .flatpickr-current-month, .theme-10 .flatpickr-weekday, .title-theme-10 { color: #009688 !important; font-weight: bold;}
.theme-10 .flatpickr-day.selected, .theme-10 .flatpickr-day.startRange, .theme-10 .flatpickr-day.endRange { background: #009688 !important; border-color: #009688 !important; color: #fff !important; }
.theme-10 .flatpickr-day.inRange { background: #ccf0eb !important; border-color: #ccf0eb !important; box-shadow: -5px 0 0 #ccf0eb, 5px 0 0 #ccf0eb !important; }

/* Theme 11: Amber */
.theme-11 #calendar-theme-wrapper { background-color: #fff5e6 !important; border: 1px solid #ffe0b3 !important; }
.theme-11 .flatpickr-current-month, .theme-11 .flatpickr-weekday, .title-theme-11 { color: #ff9800 !important; font-weight: bold;}
.theme-11 .flatpickr-day.selected, .theme-11 .flatpickr-day.startRange, .theme-11 .flatpickr-day.endRange { background: #ff9800 !important; border-color: #ff9800 !important; color: #fff !important; }
.theme-11 .flatpickr-day.inRange { background: #ffebcc !important; border-color: #ffebcc !important; box-shadow: -5px 0 0 #ffebcc, 5px 0 0 #ffebcc !important; }

/* Theme 12: Blue Grey */
.theme-12 #calendar-theme-wrapper { background-color: #eff2f3 !important; border: 1px solid #cfd8dc !important; }
.theme-12 .flatpickr-current-month, .theme-12 .flatpickr-weekday, .title-theme-12 { color: #607d8b !important; font-weight: bold;}
.theme-12 .flatpickr-day.selected, .theme-12 .flatpickr-day.startRange, .theme-12 .flatpickr-day.endRange { background: #607d8b !important; border-color: #607d8b !important; color: #fff !important; }
.theme-12 .flatpickr-day.inRange { background: #e0e6e9 !important; border-color: #e0e6e9 !important; box-shadow: -5px 0 0 #e0e6e9, 5px 0 0 #e0e6e9 !important; }

/* Theme 13: Pink Dark */
.theme-13 #calendar-theme-wrapper { background-color: #fce6ed !important; border: 1px solid #f4bacc !important; }
.theme-13 .flatpickr-current-month, .theme-13 .flatpickr-weekday, .title-theme-13 { color: #c2185b !important; font-weight: bold;}
.theme-13 .flatpickr-day.selected, .theme-13 .flatpickr-day.startRange, .theme-13 .flatpickr-day.endRange { background: #c2185b !important; border-color: #c2185b !important; color: #fff !important; }
.theme-13 .flatpickr-day.inRange { background: #f9ccdc !important; border-color: #f9ccdc !important; box-shadow: -5px 0 0 #f9ccdc, 5px 0 0 #f9ccdc !important; }

/* Theme 14: Orange Dark */
.theme-14 #calendar-theme-wrapper { background-color: #fcebe6 !important; border: 1px solid #f6c2b3 !important; }
.theme-14 .flatpickr-current-month, .theme-14 .flatpickr-weekday, .title-theme-14 { color: #e64a19 !important; font-weight: bold;}
.theme-14 .flatpickr-day.selected, .theme-14 .flatpickr-day.startRange, .theme-14 .flatpickr-day.endRange { background: #e64a19 !important; border-color: #e64a19 !important; color: #fff !important; }
.theme-14 .flatpickr-day.inRange { background: #f9d8cc !important; border-color: #f9d8cc !important; box-shadow: -5px 0 0 #f9d8cc, 5px 0 0 #f9d8cc !important; }

/* Theme 15: Dark Blue Grey */
.theme-15 #calendar-theme-wrapper { background-color: #eceff0 !important; border: 1px solid #c7d1d6 !important; }
.theme-15 .flatpickr-current-month, .theme-15 .flatpickr-weekday, .title-theme-15 { color: #455a64 !important; font-weight: bold;}
.theme-15 .flatpickr-day.selected, .theme-15 .flatpickr-day.startRange, .theme-15 .flatpickr-day.endRange { background: #455a64 !important; border-color: #455a64 !important; color: #fff !important; }
.theme-15 .flatpickr-day.inRange { background: #dce2e5 !important; border-color: #dce2e5 !important; box-shadow: -5px 0 0 #dce2e5, 5px 0 0 #dce2e5 !important; }

/* Theme 16: Dark Red */
.theme-16 #calendar-theme-wrapper { background-color: #faebeb !important; border: 1px solid #eebbbb !important; }
.theme-16 .flatpickr-current-month, .theme-16 .flatpickr-weekday, .title-theme-16 { color: #d32f2f !important; font-weight: bold;}
.theme-16 .flatpickr-day.selected, .theme-16 .flatpickr-day.startRange, .theme-16 .flatpickr-day.endRange { background: #d32f2f !important; border-color: #d32f2f !important; color: #fff !important; }
.theme-16 .flatpickr-day.inRange { background: #f4d6d6 !important; border-color: #f4d6d6 !important; box-shadow: -5px 0 0 #f4d6d6, 5px 0 0 #f4d6d6 !important; }

/* Theme 17: Dark Green */
.theme-17 #calendar-theme-wrapper { background-color: #ebf5eb !important; border: 1px solid #bce1bd !important; }
.theme-17 .flatpickr-current-month, .theme-17 .flatpickr-weekday, .title-theme-17 { color: #388e3c !important; font-weight: bold;}
.theme-17 .flatpickr-day.selected, .theme-17 .flatpickr-day.startRange, .theme-17 .flatpickr-day.endRange { background: #388e3c !important; border-color: #388e3c !important; color: #fff !important; }
.theme-17 .flatpickr-day.inRange { background: #d5ebd6 !important; border-color: #d5ebd6 !important; box-shadow: -5px 0 0 #d5ebd6, 5px 0 0 #d5ebd6 !important; }

/* Theme 18: Navy Blue */
.theme-18 #calendar-theme-wrapper { background-color: #e8f1fb !important; border: 1px solid #bbd6f5 !important; }
.theme-18 .flatpickr-current-month, .theme-18 .flatpickr-weekday, .title-theme-18 { color: #1976d2 !important; font-weight: bold;}
.theme-18 .flatpickr-day.selected, .theme-18 .flatpickr-day.startRange, .theme-18 .flatpickr-day.endRange { background: #1976d2 !important; border-color: #1976d2 !important; color: #fff !important; }
.theme-18 .flatpickr-day.inRange { background: #d3e4f7 !important; border-color: #d3e4f7 !important; box-shadow: -5px 0 0 #d3e4f7, 5px 0 0 #d3e4f7 !important; }

/* Theme 19: Slate */
.theme-19 #calendar-theme-wrapper { background-color: #f1f2f4 !important; border: 1px solid #ced4da !important; }
.theme-19 .flatpickr-current-month, .theme-19 .flatpickr-weekday, .title-theme-19 { color: #343a40 !important; font-weight: bold;}
.theme-19 .flatpickr-day.selected, .theme-19 .flatpickr-day.startRange, .theme-19 .flatpickr-day.endRange { background: #343a40 !important; border-color: #343a40 !important; color: #fff !important; }
.theme-19 .flatpickr-day.inRange { background: #e9ecef !important; border-color: #e9ecef !important; box-shadow: -5px 0 0 #e9ecef, 5px 0 0 #e9ecef !important; }

/* Theme Default */
.theme-default #calendar-theme-wrapper { background-color: #f8f9fa !important; border: 1px solid #e9ecef !important; }
.theme-default .flatpickr-current-month, .theme-default .flatpickr-weekday, .title-theme-default { color: #343a40 !important; font-weight: bold; }
.theme-default .flatpickr-day.selected, .theme-default .flatpickr-day.startRange, .theme-default .flatpickr-day.endRange { background: #343a40 !important; border-color: #343a40 !important; color: #fff !important; }
.theme-default .flatpickr-day.inRange { background: #e9ecef !important; border-color: #e9ecef !important; box-shadow: -5px 0 0 #e9ecef, 5px 0 0 #e9ecef !important; }
