/**
 * MUI X Date Picker Styles
 * Provides consistent styling for custom date picker components
 */

/* Date Picker Container */
.mui-date-picker-container {
    width: 100%;
    margin-bottom: 1rem;
}

.mui-date-picker-wrapper {
    position: relative;
}

.mui-date-picker-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.875rem;
}

.mui-date-picker-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mui-date-picker-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.mui-date-picker-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.mui-date-picker-input.error {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.mui-date-picker-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.mui-date-picker-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mui-date-picker-button:hover:not(:disabled) {
    background-color: #f5f5f5;
    color: #1976d2;
}

.mui-date-picker-button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.mui-date-picker-helper {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #666;
    min-height: 1rem;
}

.mui-date-picker-helper.error {
    color: #d32f2f;
}

.mui-date-picker-helper.correction {
    color: #1976d2;
    font-weight: 500;
}

/* Modal Overlay */
.mui-date-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.mui-date-picker-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mui-date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.mui-date-picker-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.mui-date-picker-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mui-date-picker-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.mui-date-picker-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.mui-date-picker-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    gap: 0.5rem;
}

.mui-date-picker-cancel,
.mui-date-picker-today {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.mui-date-picker-cancel:hover,
.mui-date-picker-today:hover {
    background-color: #f5f5f5;
}

.mui-date-picker-today {
    background-color: #1976d2;
    color: white;
    border-color: #1976d2;
}

.mui-date-picker-today:hover {
    background-color: #1565c0;
}

/* Calendar Styles */
.mui-date-picker-calendar {
    width: 100%;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-nav-prev,
.calendar-nav-next {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #1976d2;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.calendar-nav-prev:hover:not(:disabled),
.calendar-nav-next:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.calendar-nav-prev:disabled,
.calendar-nav-next:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-selectors {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.calendar-month-selector,
.calendar-year-selector {
    padding: 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-month-selector:focus,
.calendar-year-selector:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.calendar-month-selector:hover,
.calendar-year-selector:hover {
    border-color: #1976d2;
}

.calendar-month-year {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    padding: 0.5rem 0;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover:not(.disabled) {
    background-color: #f5f5f5;
}

.calendar-day.today {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

.calendar-day.selected {
    background-color: #1976d2;
    color: white;
    font-weight: 600;
}

.calendar-day.selected:hover {
    background-color: #1565c0;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.other-month:hover:not(.disabled) {
    background-color: #f9f9f9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mui-date-picker-overlay {
        padding: 0.5rem;
    }
    
    .mui-date-picker-modal {
        max-width: none;
        width: 100%;
        border-radius: 8px;
    }
    
    .mui-date-picker-header,
    .mui-date-picker-footer {
        padding: 1rem;
    }
    
    .mui-date-picker-content {
        padding: 0.75rem;
    }
    
    .calendar-day {
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly size */
    }
    
    .calendar-weekday {
        font-size: 0.875rem;
        padding: 0.75rem 0;
    }
    
    .mui-date-picker-cancel,
    .mui-date-picker-today {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly size */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mui-date-picker-label {
        color: #e0e0e0;
    }
    
    .mui-date-picker-input {
        background-color: #2d2d2d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .mui-date-picker-input:focus {
        border-color: #1976d2;
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
    }
    
    .mui-date-picker-input:disabled {
        background-color: #1a1a1a;
        color: #666;
    }
    
    .mui-date-picker-button {
        color: #999;
    }
    
    .mui-date-picker-button:hover:not(:disabled) {
        background-color: #3a3a3a;
        color: #1976d2;
    }
    
    .mui-date-picker-helper {
        color: #999;
    }
    
    .mui-date-picker-helper.error {
        color: #f44336;
    }
    
    .mui-date-picker-helper.correction {
        color: #64b5f6;
        font-weight: 500;
    }
    
    .mui-date-picker-modal {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .mui-date-picker-header {
        border-bottom-color: #555;
    }
    
    .mui-date-picker-header h3 {
        color: #e0e0e0;
    }
    
    .mui-date-picker-close {
        color: #999;
    }
    
    .mui-date-picker-close:hover {
        background-color: #3a3a3a;
        color: #e0e0e0;
    }
    
    .mui-date-picker-footer {
        border-top-color: #555;
    }
    
    .mui-date-picker-cancel,
    .mui-date-picker-today {
        background: #3a3a3a;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .mui-date-picker-cancel:hover,
    .mui-date-picker-today:hover {
        background-color: #4a4a4a;
    }
    
    .mui-date-picker-today {
        background-color: #1976d2;
        color: white;
        border-color: #1976d2;
    }
    
    .mui-date-picker-today:hover {
        background-color: #1565c0;
    }
    
    .calendar-month-year {
        color: #e0e0e0;
    }
    
    .calendar-weekday {
        color: #999;
    }
    
    .calendar-day:hover:not(.disabled) {
        background-color: #3a3a3a;
    }
    
    .calendar-day.today {
        background-color: #1a237e;
        color: #90caf9;
    }
    
    .calendar-day.disabled {
        color: #666;
        background-color: #1a1a1a;
    }
    
    .calendar-day.other-month {
        color: #666;
    }
    
    .calendar-day.other-month:hover:not(.disabled) {
        background-color: #1a1a1a;
    }
    
    .calendar-month-selector,
    .calendar-year-selector {
        background-color: #2d2d2d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .calendar-month-selector:focus,
    .calendar-year-selector:focus {
        border-color: #1976d2;
        box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    }
    
    .calendar-month-selector:hover,
    .calendar-year-selector:hover {
        border-color: #1976d2;
    }
}
