/**
 * M'On Too Calendar Styles
 * Responsive calendar component for partner and client booking
 */

/* Calendar Error Message */
.montoo-calendar-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.montoo-calendar-error p {
    margin: 0;
    font-size: 16px;
}

/* Main Calendar Container */
.montoo-calendar {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Calendar Header */
.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.view-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 500;
}

.calendar-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.calendar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
    color: white;
}

.calendar-mode-info {
    margin-top: 10px;
}

.mode-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.mode-badge.partner {
    background: rgba(255, 193, 7, 0.3);
    color: #fff3cd;
}

.mode-badge.client {
    background: rgba(40, 167, 69, 0.3);
    color: #d1f2d9;
}

.mode-badge.global {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-mode-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Calendar Grid */
.calendar-grid {
    padding: 20px;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    padding: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    min-height: 60px;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    transform: translateY(-1px);
}

.calendar-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day.past {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.calendar-day.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.calendar-day.has-existing-availability {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    border-color: #17a2b8;
    position: relative;
}

.calendar-day.has-existing-availability:hover {
    background: linear-gradient(135deg, #138496 0%, #1dd1a1 100%);
    transform: translateY(-1px);
}

.calendar-day.has-existing-availability::after {
    content: '⋯';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.9;
}

.calendar-day.all-slots-used {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    border-color: #dc3545;
    cursor: not-allowed;
    position: relative;
}

.calendar-day.all-slots-used:hover {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    transform: none;
    cursor: not-allowed;
}

.calendar-day.all-slots-used::after {
    content: '✕';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0.9;
}

.day-number {
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}

.day-indicators {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.indicator.available {
    background: #28a745;
}

.indicator.booked {
    background: #dc3545;
}

/* Time Slots */
.calendar-time-slots {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.calendar-time-slots h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 500;
}

.time-slots-instructions {
    background: #f8f9fa;
    border-left: 4px solid #17a2b8;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    line-height: 1.4;
}

.time-slots-instructions strong {
    color: #17a2b8;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.time-slot {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    font-size: 14px;
}

.time-slot:hover {
    background: #e9ecef;
    border-color: #6c757d;
}

.time-slot.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}


.time-slot.user-selection {
    background: #6f42c1;
    color: white;
    border-color: #6f42c1;
    cursor: pointer;
    position: relative;
}

.time-slot.user-selection:hover {
    background: #5a32a3;
    border-color: #5a32a3;
}

.time-slot.user-selection::before {
    content: '×';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.time-slot.user-selection:hover::before {
    opacity: 1;
}

.time-slot.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8f9fa;
    position: relative;
}

.time-slot.unavailable::after {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc3545;
    font-weight: bold;
    font-size: 16px;
}

.time-slot.booked-by-other {
    opacity: 0.8;
    cursor: help;
    pointer-events: auto !important;
    background: #0066cc; /* Bleu pour les slots partenaires */
    color: white !important;
    position: relative;
    border: 2px solid #0052a3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot.booked-by-other::after {
    content: '🔒';
    font-size: 12px;
    font-weight: bold;
}

/* Monthly view - slots booked by other clients (not partners) */
.time-slot.booked-by-clients {
    opacity: 0.8;
    cursor: pointer;
    pointer-events: auto !important;
    background: #555555;
    color: white !important;
    position: relative;
    border: 2px dashed #888888 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No icon for booked-by-clients - just the dashed border */
.time-slot.booked-by-clients::after {
    content: '';
}

.time-slot.no-capacity {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    background: #ff6b6b !important;
    color: white !important;
    border: 2px solid #d63031 !important;
    position: relative;
}

.time-slot.no-capacity::after {
    content: '👥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

.time-slot.no-capacity[title]::before {
    content: '';
}

/* Weekly view - slots booked by other partners */
.weekly-time-slot.booked-by-other {
    opacity: 0.8;
    cursor: help;
    pointer-events: auto !important;
    background: #0066cc; /* Bleu pour les slots partenaires */
    color: white !important;
    position: relative;
    border: 2px solid #0052a3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekly-time-slot.booked-by-other::after {
    content: '🔒';
    font-size: 10px;
    font-weight: bold;
}

/* Weekly view - slots booked by other clients (not partners) */
.weekly-time-slot.booked-by-clients {
    opacity: 0.8;
    cursor: pointer;
    pointer-events: auto !important;
    background: #555555;
    color: white !important;
    position: relative;
    border: 2px dashed #888888 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No icon for booked-by-clients - just the dashed border */
.weekly-time-slot.booked-by-clients::after {
    content: '';
}

.weekly-time-slot.no-capacity {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    background: #ff6b6b !important;
    color: white !important;
    border: 2px solid #d63031 !important;
    position: relative;
}

.weekly-time-slot.no-capacity::after {
    content: '👥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
}

/* Tooltip styling for booked-by-other slots */
.time-slot.booked-by-other,
.weekly-time-slot.booked-by-other {
    pointer-events: auto !important;
}

/* Activity tooltip element styling */
.activity-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    border: 1px solid #555555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    pointer-events: none;
}

/* Show tooltip on hover of parent slot */
.time-slot.booked-by-other:hover .activity-tooltip,
.weekly-time-slot.booked-by-other:hover .activity-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Add arrow to tooltip */
.activity-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333333;
}


.time-slot.client-booked,
.weekly-time-slot.client-booked {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    position: relative;
}

.time-slot.client-booked.session-start,
.weekly-time-slot.client-booked.session-start {
    cursor: pointer;
    border: 3px solid #28a745 !important;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5) !important;
}

.time-slot.client-booked.session-continuation,
.weekly-time-slot.client-booked.session-continuation {
    cursor: not-allowed;
    opacity: 0.8;
    border-left: 2px solid #1e7e34 !important;
}

.time-slot.available.session-start,
.weekly-time-slot.available.session-start {
    cursor: pointer;
    border: 3px solid #0066cc !important;
    box-shadow: 0 0 5px rgba(0, 102, 204, 0.5) !important;
}

.time-slot.available.session-continuation,
.weekly-time-slot.available.session-continuation {
    cursor: not-allowed;
    opacity: 0.7;
    border-left: 2px solid #6c757d !important;
}

.time-slot.client-booked::after,
.weekly-time-slot.client-booked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: white !important;
}

.calendar-day.not-modifiable {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.calendar-day.not-modifiable::before {
    content: '🔒';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    opacity: 0.8;
}

/* Appointments mode styles (read-only) */
.montoo-appointments-calendar .weekly-time-slot,
.montoo-appointments-calendar .time-slot {
    cursor: default !important;
}

.montoo-appointments-calendar .weekly-time-slot:hover,
.montoo-appointments-calendar .time-slot:hover {
    transform: none !important;
}

.montoo-appointments-calendar .client-booked {
    cursor: default !important;
}

/* Appointments mode: Condensed weekly view */
.montoo-appointments-calendar.weekly-view-appointments {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.montoo-appointments-calendar .weekly-view {
    display: block !important; /* Always show weekly view in appointments mode */
}

.montoo-appointments-calendar .calendar-grid {
    display: none !important; /* Hide monthly grid in appointments mode */
}

/* Hide the complex grid structure for appointments */
.montoo-appointments-calendar .week-day-labels,
.montoo-appointments-calendar .weekly-body {
    display: none;
}

/* Create simplified appointments view */
.appointments-weekly-simple {
    padding: 20px;
}

.appointments-day {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.appointments-day h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

.appointments-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appointment-session {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.appointment-session:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.session-time {
    font-size: 16px;
    font-weight: 700;
    margin-right: 15px;
    min-width: 60px;
}

.session-activity {
    flex: 1;
    font-size: 14px;
}

.session-duration {
    font-size: 12px;
    opacity: 0.9;
    margin-left: 10px;
}

.no-appointments {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Different colors for different activities in appointments view */
.appointment-session.activity-1721 {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%); /* Rouge pour Hatha Yoga */
}

.appointment-session.activity-1729 {
    background: linear-gradient(135deg, #4ECDC4 0%, #26A69A 100%); /* Turquoise pour Chakra Yoga */
}

.appointment-session.activity-1735 {
    background: linear-gradient(135deg, #45B7D1 0%, #2196F3 100%); /* Bleu pour Hatha Yoga */
}

.appointment-session.activity-1731 {
    background: linear-gradient(135deg, #96CEB4 0%, #4CAF50 100%); /* Vert pour Pilates */
}

.appointment-session.activity-1728 {
    background: linear-gradient(135deg, #FFEAA7 0%, #FFC107 100%); /* Jaune pour Sono-Yin Yoga */
    color: #2d3436 !important;
}

.appointment-session.activity-1730 {
    background: linear-gradient(135deg, #DDA0DD 0%, #9C27B0 100%); /* Violet pour Yoga Nidra */
}

/* Fallback for unknown activities */
.appointment-session.activity-unknown {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Activity legend for appointments */
.appointments-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Selection Summary */
.calendar-selection {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #ffffff;
}

.calendar-selection h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 500;
}

.selected-slots {
    margin-bottom: 20px;
    min-height: 50px;
}

.no-selection {
    color: #6c757d;
    font-style: italic;
    margin: 20px 0;
    text-align: center;
}

.selected-dates {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-dates li {
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #e3f2fd;
    border-radius: 6px;
    color: #0277bd;
    border-left: 4px solid #2196f3;
    font-size: 14px;
}

.selected-dates li.time-range {
    background: #e8f5e8;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.selected-dates li.individual-slots {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #ef6c00;
}

.selected-dates .time-display {
    font-weight: bold;
    font-size: 16px;
    color: inherit;
    display: block;
    margin-top: 2px;
}

/* Existing/Saved selections */
.selected-dates.existing-selections li {
    background: #e8f5e8;
    border-left-color: #28a745;
    color: #155724;
}

.selected-dates li.saved-range {
    background: #e8f5e8;
    border-left-color: #28a745;
    color: #155724;
    position: relative;
}

.selected-dates li.saved-range::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 8px;
    color: #28a745;
    font-weight: bold;
}

.selected-dates li.saved-slots {
    background: #e8f5e8;
    border-left-color: #28a745;
    color: #155724;
}

/* Recurring Option */
.recurring-option {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.recurring-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.recurring-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.recurring-info {
    margin: 8px 0 0 28px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Recurring calendar day styling */
.calendar-day.recurring-availability {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.3) 0%, rgba(32, 201, 151, 0.3) 100%);
    color: #495057;
    border: 1px dashed #17a2b8;
    position: relative;
}

.calendar-day.recurring-availability:hover {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.4) 0%, rgba(32, 201, 151, 0.4) 100%);
    transform: translateY(-1px);
}

.calendar-day.recurring-availability::after {
    content: '↻';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0.7;
    color: #17a2b8;
}

/* Mobile Weekly Day Section and Header - Base Styles */
.weekly-day-section {
    display: block;
}

.weekly-day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border: none;
    margin: 0;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
}

.weekly-day-header.today {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.weekly-day-header .day-info {
    display: flex;
    gap: 8px;
    align-items: baseline;
    width: 100%;
}

.weekly-day-header .day-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    color: white;
}

.weekly-day-header .day-number {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.weekly-day-slots {
    display: grid;
    gap: 8px;
    padding: 12px;
}

/* Mobile weekly body container */
.weekly-body-mobile {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Action Buttons */
.calendar-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.calendar-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-clear {
    background: #6c757d;
    color: white;
}

.btn-clear:hover {
    background: #545b62;
}

.btn-confirm {
    background: #28a745;
    color: white;
}

.btn-confirm:hover:not(.disabled) {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-confirm.disabled {
    background: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State */
.calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.calendar-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

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

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

.calendar-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.calendar-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Weekly View - Show/Hide based on viewport */
.weekly-view-desktop {
    display: block !important;
}

.weekly-view-mobile {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hide desktop weekly view on mobile */
    .weekly-view-desktop {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Show mobile weekly view on mobile */
    .weekly-view-mobile {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Mobile weekly body layout */
    .weekly-body-mobile {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .montoo-calendar {
        margin: 10px;
        border-radius: 8px;
    }

    .calendar-header {
        padding: 15px;
    }
    
    .calendar-title {
        font-size: 20px;
    }
    
    .calendar-grid {
        padding: 15px;
    }
    
    .calendar-day {
        min-height: 50px;
        font-size: 14px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
    }
    
    .time-slot {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .calendar-actions {
        flex-direction: column;
    }
    
    .calendar-actions button {
        width: 100%;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .calendar-header {
        padding: 12px;
    }
    
    .calendar-grid {
        padding: 10px;
    }
    
    .calendar-selection,
    .calendar-time-slots {
        padding: 15px;
    }
    
    .calendar-day {
        min-height: 45px;
    }
    
    .day-header {
        padding: 8px 4px;
        font-size: 11px;
    }
}

/* Activity Colors Legend */
.activity-colors-legend {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.activity-colors-legend h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.legend-description {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin: 15px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-activity-name {
    font-weight: 500;
    color: #495057;
}

.legend-note {
    margin: 12px 0 0 0;
    color: #6c757d;
    font-style: italic;
}

.legend-note small {
    font-size: 12px;
}

/* Client Activity Selector */
.client-activity-selector {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.activity-selector-container label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
}

.activity-selector-container .activity-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.activity-selector-container .activity-select:focus {
    outline: none;
    border-color: #667eea;
}

.activity-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.activity-sessions-counter {
    background: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    color: #495057;
}

#sessions-available {
    font-weight: 500;
}

/* Animation for calendar transitions */
.montoo-calendar {
    animation: fadeInUp 0.5s ease-out;
}

/* Hide calendar when no activity selected in client mode */
.montoo-calendar.calendar-hidden-no-activity {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Weekly View Styles */
.weekly-view {
    padding: 20px;
    background: #ffffff;
}

.weekly-view-hidden {
    display: none;
}

.weekly-header {
    margin-bottom: 0;
}

.week-day-labels {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background-color: #e9ecef;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.week-day-label {
    background: #f8f9fa;
    padding: 12px 5px;
    text-align: center;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.week-day-label.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.week-day-label.time-header-label {
    background: #f8f9fa;
    border: none;
}

.week-day-label:last-child {
    border-right: none;
}

.day-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-number {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.weekly-body {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background-color: #e9ecef;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
    gap: 1px;
}

/* Time column is now part of the main grid */

.time-header {
    height: 50px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.time-label {
    height: 31px;
    padding: 0 4px;
    font-size: 11px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    box-sizing: border-box;
}

/* Make full hours bold in time labels */
.time-label[data-time$=":00"] {
    font-weight: bold;
    color: #495057;
    font-size: 12px;
}

/* .week-days-grid is now part of .weekly-body grid */

.day-header {
    height: 50px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.weekly-time-slot {
    height: 31px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

.weekly-time-slot.past {
    background: #f8f9fa;
    opacity: 0.6;
}

.weekly-time-slot:hover[data-selectable="true"] {
    background-color: rgba(102, 126, 234, 0.1);
}

.weekly-time-slot.available {
    opacity: 0.7;
    border-left: 3px solid currentColor;
}

.weekly-time-slot.available:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.weekly-time-slot.booked {
    background-color: #dc3545;
    color: white;
    cursor: not-allowed;
    pointer-events: none;
}

/* Allow clicking on booked slots (other clients' bookings) in client mode - styling will override via JavaScript */
.weekly-time-slot.booked:not(.client-booked) {
    cursor: pointer;
    pointer-events: auto;
}

.weekly-time-slot.booked::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

/* Booked-by-clients slots should show dashed border without X icon */
.weekly-time-slot.booked.booked-by-clients {
    border: 2px dashed #888888 !important;
    cursor: pointer;
    pointer-events: auto;
}

.weekly-time-slot.booked.booked-by-clients::after {
    content: '';
}

.weekly-time-slot.selected {
    border-left: 4px solid currentColor;
    opacity: 1;
    font-weight: bold;
}

.weekly-time-slot.client-selected {
    background-color: #28a745;
    color: white;
    border-left: 4px solid #1e7e34;
}

.weekly-time-slot.client-selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.weekly-time-slot.recurring {
    opacity: 0.5;
    border-style: dashed;
}

.weekly-time-slot.recurring::before {
    content: '↻';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Loading indicator for instant save/delete */
.weekly-time-slot.loading {
    opacity: 0.6;
    background: repeating-linear-gradient(
        45deg,
        #f8f9fa,
        #f8f9fa 10px,
        #e9ecef 10px,
        #e9ecef 20px
    );
    animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

.weekly-time-slot.loading::after {
    content: '⌛';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    animation: loading-pulse 1s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Weekly View Responsive */
@media (max-width: 768px) {
    .weekly-view {
        padding: 15px;
    }

    /* Hide traditional grid structure on mobile */
    .week-day-labels {
        display: none;
    }

    .weekly-body {
        display: flex;
        flex-direction: column;
        grid-template-columns: unset;
        max-height: none;
        gap: 0;
    }

    /* Create day sections on mobile */
    .weekly-day-section {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        background: white;
    }

    .weekly-day-section.today-section {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

    .weekly-day-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 12px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #555;
    }

    .weekly-day-header.today {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    }

    .weekly-day-header .day-info {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .weekly-day-header .day-name {
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .weekly-day-header .day-number {
        font-size: 18px;
        font-weight: 700;
    }

    .weekly-day-slots {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .weekly-time-slot {
        height: auto;
        min-height: 45px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        padding: 8px 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 500;
    }

    /* Remove grid-specific styling for slots */
    .time-header {
        display: none;
    }

    .time-label {
        display: none;
    }

    .day-header {
        display: none;
    }
}

@media (max-width: 480px) {
    .weekly-view {
        padding: 10px;
    }

    .weekly-day-section {
        margin-bottom: 15px;
    }

    .weekly-day-header {
        padding: 10px 12px;
    }

    .weekly-day-header .day-name {
        font-size: 12px;
    }

    .weekly-day-header .day-number {
        font-size: 16px;
    }

    .weekly-day-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }

    .weekly-time-slot {
        min-height: 40px;
        font-size: 11px;
        padding: 6px 2px;
    }
}

/* Mobile Monthly View - Day-by-day layout */
@media (max-width: 768px) {
    /* Hide day headers in grid format */
    .calendar-days-header {
        display: none;
    }

    /* Change grid from 7 columns to 1 column */
    .calendar-days-body {
        grid-template-columns: 1fr;
        gap: 0;
        display: flex;
        flex-direction: column;
    }

    /* Mobile day card styling */
    .calendar-day-mobile {
        display: flex;
        flex-direction: column;
        padding: 0;
        border: none;
        border-bottom: 1px solid #e9ecef;
        background: #ffffff;
        border-radius: 0;
        cursor: pointer;
        transition: background-color 0.2s ease;
        min-height: auto;
        aspect-ratio: auto;
    }

    .calendar-day-mobile:last-child {
        border-bottom: none;
    }

    .calendar-day-mobile:hover {
        background: #f8f9fa;
    }

    /* Mobile day header - contains day name and date */
    .mobile-day-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
        gap: 10px;
    }

    .mobile-day-info {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .mobile-day-name {
        font-size: 13px;
        font-weight: 600;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-day-number {
        font-size: 18px;
        font-weight: 600;
        color: #495057;
    }

    .calendar-day-mobile .day-indicators {
        display: flex;
        gap: 4px;
        margin: 0;
    }

    /* Status indicator styles on mobile */
    .calendar-day-mobile.today .mobile-day-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .calendar-day-mobile.today .mobile-day-name,
    .calendar-day-mobile.today .mobile-day-number {
        color: white;
    }

    .calendar-day-mobile.today {
        background: rgba(102, 126, 234, 0.03);
    }

    .calendar-day-mobile.selected .mobile-day-header {
        background: #007bff;
    }

    .calendar-day-mobile.selected .mobile-day-name,
    .calendar-day-mobile.selected .mobile-day-number {
        color: white;
    }

    .calendar-day-mobile.selected {
        background: rgba(0, 123, 255, 0.03);
    }

    .calendar-day-mobile.past {
        opacity: 0.5;
        pointer-events: none;
    }

    .calendar-day-mobile.past .mobile-day-header {
        background: #f0f0f0;
    }

    /* Remove old desktop calendar-day styles */
    .calendar-day {
        display: none;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .mobile-day-header {
        padding: 10px 12px;
    }

    .mobile-day-name {
        font-size: 12px;
    }

    .mobile-day-number {
        font-size: 16px;
    }

    .calendar-grid {
        padding: 0;
    }
}