/**
 * Custom Calendar Styles
 * Provides styling for the custom appointment booking calendar
 */

/* Calendar Container */
.custom-calendar-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 300px;
    max-width: 350px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: absolute;
}

/* Calendar Widget */
.calendar-widget {
    padding: 16px;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-header button {
    background: #f3f4f6;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    color: #374151;
}

.calendar-header button:hover {
    background: #e5e7eb;
}

.calendar-header button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.month-year {
    font-size: 18px;
    font-weight: 600;
    color: #111827 !important;
    margin: 0;
}




/* Calendar Grid */
.calendar-grid {
    width: 100%;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    font-weight: 500;
    color: #6b7280;
    padding: 8px 4px;
    font-size: 12px;
    text-transform: uppercase;
}

/* Weekend headers styling */
.weekday:first-child,
.weekday:last-child {
    color: #9ca3af;
    font-weight: 400;
}

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

/* Day Cells */
.day {
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #111827;
}

/* Normal day hover */
.day:hover:not(.empty):not([data-disabled="true"]) {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* Empty day (padding cells) */
.day.empty {
    cursor: default;
}

/* Past days */
.day.past {
    color: #9ca3af;
    background-color: #f9fafb;
    cursor: not-allowed;
}

.day.past:hover {
    background-color: #f9fafb !important;
    color: #9ca3af !important;
}

/* Today */
.day.today {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 700;
}

/* Full Day Holidays */
.day.holiday-full {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    cursor: not-allowed;
}

.day.holiday-full:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

/* Half Day Holidays */
.day.holiday-half {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
    cursor: pointer;
}

.day.holiday-half:hover {
    background-color: #fef3c7 !important;
    color: #d97706 !important;
}

/* Weekend days */
.day.weekend {
    color: #9ca3af;
    background-color: #f9fafb;
    cursor: not-allowed;
}

.day.weekend:hover {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
}

/* Disabled state */
.day[data-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
}
.day[data-disabled="true"]:hover {
    opacity: 1;
}

/* Input field styling */
input[name="date"][readonly] {
    cursor: pointer;
}

input[name="date"][readonly]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.salesman_busy_tag {
    width: auto;
    background: #ffe0e0;
    top: 25px;
    z-index: 1;
    font-size: 14px;
    right: 25px;
    padding: 1px 10px;
    position: absolute;
    border-radius: 8px;
}

.salesman_busy_tag {
    color: #ff6b6b;
}

.complete_appt_book input[type="date"]::-webkit-calendar-picker-indicator,
.quick_appt_book input[type="date"]::-webkit-calendar-picker-indicator,
.smart_appt_book input[type="date"]::-webkit-calendar-picker-indicator{
    pointer-events: none;
}

/* Holiday tooltip styling */
.day[data-holiday="true"][data-tooltip]:hover::after {
    content: attr(data-tooltip);
}
.day[data-holiday="true"][title]:hover::after {
    content: attr(title);
}
.day[data-holiday="true"][data-tooltip]:hover::after,
.day[data-holiday="true"][title]:hover::after {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    margin-bottom: 4px;
    pointer-events: none;
}
.day[data-holiday="true"][data-tooltip]:hover::before,
.day[data-holiday="true"][title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 1001;
    pointer-events: none;
}

/* Selected date styling */
.day.selected {
    background-color: #3b82f6;
    color: white;
    font-weight: 700;
}

.day.selected:hover {
    background-color: #2563eb !important;
    color: white !important;
}

/* Loading state */
.calendar-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.calendar-widget.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: cspin 1s linear infinite;
    z-index: 10;
}

@keyframes cspin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .custom-calendar-container {
        min-width: 280px;
        max-width: 320px;
    }
    
    .calendar-widget {
        padding: 12px;
    }
    
    .day {
        min-height: 28px;
        font-size: 13px;
    }
    
    .month-year {
        font-size: 16px;
    }
    
    .calendar-header button {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* Dark theme support - Manual activation only */
.custom-calendar-container.dark-theme {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.custom-calendar-container.dark-theme .month-year {
    color: #f9fafb;
}

.custom-calendar-container.dark-theme .calendar-header button {
    background: #374151;
    color: #f9fafb;
}

.custom-calendar-container.dark-theme .calendar-header button:hover {
    background: #4b5563;
}

.custom-calendar-container.dark-theme .weekday {
    color: #9ca3af;
}

.custom-calendar-container.dark-theme .day {
    color: #f9fafb;
}

.custom-calendar-container.dark-theme .day:hover:not(.empty):not([data-disabled="true"]) {
    background-color: #1e40af;
    color: white;
}

.custom-calendar-container.dark-theme .day.past {
    color: #6b7280;
    background-color: #374151;
}

.custom-calendar-container.dark-theme .day.today {
    background-color: #1e40af;
    color: white;
}

#layoutDemo .timepicker-group label{color: #000;}
.timepicker-group {background:unset !important;display:block !important}
.timepicker-group .timepicker-option{max-width: 100px;min-width: 100px;margin: 4px 7px !important;cursor: pointer;}
.timepicker-group .timepicker-option label {color: #000;text-align:center}
.theme-dark_mode .timepicker-group .fontcolor{color:#fff !important}
.salesman-picker-group{display:block}
.salesman-picker-group .salesman-option{max-width: 340px;margin: 5px !important;}
.salesman-picker-group .wCalcname{width:calc(100% - 35px)}

.half-day-note {
    width: 100%;
    float: left;
}
/* Animation for calendar appearance */
.custom-calendar-container {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.day:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.calendar-header button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .day {
        border: 1px solid transparent;
    }
    
    .day:hover:not(.empty):not([data-disabled="true"]) {
        border-color: #1d4ed8;
    }
    
    .day.holiday-full {
        border-color: #dc2626;
        border-width: 2px;
    }
    
    .day.holiday-half {
        border-color: #d97706;
        border-width: 2px;
    }
}

/* No slots available styling */
.day.no-slots {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.day.no-slots:hover {
    background-color: #fde68a !important;
    color: #78350f !important;
}

/* Extended tooltip styling for all tooltip types */
.day[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    margin-bottom: 4px;
    pointer-events: none;
}

.day[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 1001;
    pointer-events: none;
}

/* Print styles */
@media print {
    .custom-calendar-container {
        display: none;
    }
} 
