/* Custom Calendar Styles for Doctor Registration */

/* Date Input Wrapper */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-date-input {
    padding-right: 40px !important;
    cursor: pointer;
    background-color: white !important;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.custom-date-input:focus {
    border-color: #4361ee !important;
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
    outline: none;
}

.custom-date-input:active {
    background-color: #f8f9fa !important;
}

.calendar-icon {
    position: absolute;
    right: 12px;
    color: #6c757d;
    z-index: 10;
    transition: color 0.3s ease;
    cursor: pointer;
}

.custom-date-input:hover + .calendar-icon {
    color: #4361ee;
}

/* Custom Calendar Container */
.custom-calendar {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: none;
    overflow: hidden;
    width: 280px;
    margin-top: 5px;
}

.custom-calendar.show {
    display: block;
    animation: calendarSlideDown 0.2s ease-out;
}

@keyframes calendarSlideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Calendar Header - Blue Theme Design */
.calendar-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
    color: white;
    padding: 12px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #4361ee;
}

.calendar-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: white;
}

.calendar-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #6c757d;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.calendar-nav:hover {
    background: #e9ecef;
    color: #4361ee;
    border-color: #4361ee;
}

.calendar-nav.prev {
    left: 12px;
}

.calendar-nav.next {
    right: 12px;
}

.calendar-nav svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Calendar Body */
.calendar-body {
    padding: 12px;
    background: white;
}

/* Weekdays */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    padding: 6px 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Calendar Days */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    min-height: 32px;
}

.calendar-day:hover:not(.disabled) {
    background: #f8f9fa;
    color: #4361ee;
}

.calendar-day.selected {
    background: #4361ee;
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    border: 2px solid #4361ee;
    color: #4361ee;
    font-weight: 600;
}

.calendar-day.today.selected {
    background: #4361ee;
    color: white;
    border-color: #4361ee;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
}

.calendar-day.other-month {
    color: #ccc;
}

/* Calendar Footer */
.calendar-footer {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.calendar-today-btn {
    background: #4361ee;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.calendar-today-btn:hover {
    background: #3a56d4;
}

.calendar-clear-btn {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.calendar-clear-btn:hover {
    background: #6c757d;
    color: white;
}

/* Year/Month Selector */
.calendar-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white !important;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    color: #333 !important;
}

.calendar-select:focus {
    outline: none;
    border-color: #4361ee;
}

/* Responsive Design */
@media (max-width: 480px) {
    .custom-calendar {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 8px;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }
    
    .calendar-header {
        padding: 12px 10px;
        border-radius: 12px 12px 0 0;
    }
    
    .calendar-title {
        font-size: 13px;
    }
    
    .calendar-nav {
        width: 24px;
        height: 24px;
    }
    
    .calendar-nav svg {
        width: 12px;
        height: 12px;
    }
    
    .calendar-body {
        padding: 10px;
    }
    
    .calendar-weekday {
        font-size: 10px;
        padding: 4px 1px;
    }
    
    .calendar-day {
        font-size: 11px;
        min-height: 26px;
        border-radius: 6px;
    }
    
    .calendar-footer {
        padding: 10px;
        border-radius: 0 0 12px 12px;
    }
    
    .calendar-today-btn,
    .calendar-clear-btn {
        padding: 8px 12px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .calendar-selector {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .calendar-select {
        padding: 8px 6px;
        font-size: 11px;
        border-radius: 6px;
    }
}

@media (max-width: 360px) {
    .custom-calendar {
        width: 260px;
    }
    
    .calendar-day {
        min-height: 24px;
        font-size: 10px;
    }
    
    .calendar-weekday {
        font-size: 9px;
        padding: 3px 1px;
    }
}

@media (max-width: 320px) {
    .custom-calendar {
        width: 240px;
    }
    
    .calendar-header {
        padding: 10px 8px;
    }
    
    .calendar-body {
        padding: 8px;
    }
    
    .calendar-footer {
        padding: 8px;
    }
}

/* Tablet Portrait */
@media (min-width: 481px) and (max-width: 768px) {
    .custom-calendar {
        width: 300px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 10px;
    }
    
    .calendar-day {
        min-height: 30px;
        font-size: 12px;
    }
    
    .calendar-weekday {
        font-size: 11px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-calendar {
        width: 320px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .calendar-body {
        padding: 8px;
    }
    
    .calendar-day {
        min-height: 24px;
        font-size: 11px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .custom-calendar {
        width: 320px;
        border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .calendar-header {
        padding: 16px;
        border-radius: 12px 12px 0 0;
    }
    
    .calendar-title {
        font-size: 16px;
    }
    
    .calendar-nav {
        width: 32px;
        height: 32px;
    }
    
    .calendar-nav svg {
        width: 16px;
        height: 16px;
    }
    
    .calendar-body {
        padding: 16px;
    }
    
    .calendar-weekday {
        font-size: 12px;
        padding: 8px 2px;
    }
    
    .calendar-day {
        font-size: 14px;
        min-height: 36px;
        border-radius: 6px;
    }
    
    .calendar-footer {
        padding: 16px;
        border-radius: 0 0 12px 12px;
    }
    
    .calendar-today-btn,
    .calendar-clear-btn {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .calendar-select {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-calendar {
        border-width: 0.5px;
    }
    
    .calendar-day {
        border-width: 0.5px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .custom-calendar.show {
        animation: none;
    }
    
    .calendar-day {
        transition: none;
    }
    
    .calendar-nav {
        transition: none;
    }
    
    .calendar-today-btn,
    .calendar-clear-btn {
        transition: none;
    }
}

/* Dark Mode Support - Only apply when user prefers dark mode */
@media (prefers-color-scheme: dark) {
    .custom-calendar:not(.force-light-mode) {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-header {
        background: linear-gradient(135deg, #4c51bf 0%, #434190 100%);
        color: white;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-body {
        background: #2d3748;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-weekday {
        color: #a0aec0;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day {
        color: #e2e8f0;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day:hover:not(.disabled) {
        background: #4a5568;
        color: #63b3ed;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day.selected {
        background: #4c51bf;
        color: white;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day.today {
        border-color: #4c51bf;
        color: #4c51bf;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day.today.selected {
        background: #4c51bf;
        color: white;
        border-color: #4c51bf;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day.disabled {
        color: #718096;
        background: #4a5568;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-day.other-month {
        color: #718096;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-footer {
        background: #4a5568;
        border-top-color: #718096;
    }
    
    /* Keep dropdowns visible even in dark mode */
    .custom-calendar:not(.force-light-mode) .calendar-select {
        background: white !important;
        border-color: #718096;
        color: #333 !important;
    }
    
    .custom-calendar:not(.force-light-mode) .calendar-select:focus {
        border-color: #4c51bf;
    }
}

/* Custom scrollbar for month/year dropdowns */
.calendar-select::-webkit-scrollbar {
    width: 4px;
}

.calendar-select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.calendar-select::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.calendar-select::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 