/* calendar_date_picker.css */
/* Standalone calendar date picker component styles */

/* ===================================================================
   CALENDAR CONTAINER
   =================================================================== */

.cdp-calendar {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 13px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    width: fit-content;
}

.cdp-calendar.cdp-inline {
    /* Embedded calendar */
    display: block;
}

.cdp-calendar.cdp-popup {
    /* Popup calendar (if needed) */
    position: absolute;
    z-index: 1000;
}

/* ===================================================================
   HEADER & NAVIGATION
   =================================================================== */

.cdp-header {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.cdp-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cdp-nav-btn {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #495057;
    transition: all 0.2s;
    padding: 0;
}

.cdp-nav-btn:hover {
    background: #0D882C;
    border-color: #0D882C;
    color: white;
}

.cdp-nav-btn:active {
    transform: scale(0.95);
}

.cdp-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 136, 44, 0.2);
}

.cdp-nav-btn svg {
    width: 14px;
    height: 14px;
}

.cdp-current-month-year {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    flex: 1;
    white-space: nowrap;
}

/* ===================================================================
   CALENDAR BODY
   =================================================================== */

.cdp-body {
    padding: 8px;
}

.cdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.cdp-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px;
}

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

/* ===================================================================
   DAY CELLS
   =================================================================== */

.cdp-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    background: white;
    color: #495057;
    transition: all 0.15s;
    padding: 0;
}

.cdp-day:hover:not(.cdp-disabled) {
    background: #e9ecef;
    border-color: #0D882C;
}

.cdp-day:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 136, 44, 0.3);
    z-index: 1;
}

/* Other month days */
.cdp-day.cdp-other-month {
    color: #adb5bd;
    background: #f8f9fa;
}

/* Disabled days */
.cdp-day.cdp-disabled {
    color: #dee2e6;
    cursor: not-allowed;
    background: #f8f9fa;
    opacity: 0.5;
}

.cdp-day.cdp-disabled:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Today */
.cdp-day.cdp-today {
    background: #fff3cd;
    color: #856404;
    font-weight: bold;
    border-color: #ffc107;
}

.cdp-day.cdp-today:hover:not(.cdp-disabled) {
    background: #ffe69c;
}

/* Selected date */
.cdp-day.cdp-selected {
    background: #0D882C;
    color: white;
    font-weight: bold;
    border-color: #0D882C;
}

.cdp-day.cdp-selected:hover {
    background: #0b7a26;
    border-color: #0b7a26;
}

/* Weekend days */
.cdp-day.cdp-weekend {
    color: #dc3545;
}

.cdp-day.cdp-weekend.cdp-other-month {
    color: #f5c6cb;
}

/* Off-days (holidays) */
.cdp-day.cdp-off-day {
    background-color: #ffe5e5;
    color: #721c24;
}

.cdp-day.cdp-off-day:hover:not(.cdp-disabled) {
    background-color: #ffcccc;
    border-color: #f5c6cb;
}

.cdp-day.cdp-off-day.cdp-other-month {
    background-color: #fff0f0;
    color: #d6a8ac;
}

/* Combined states */
.cdp-day.cdp-off-day.cdp-today {
    background: #ffe5cc;
    color: #856404;
    border-color: #ffc107;
}

.cdp-day.cdp-off-day.cdp-selected,
.cdp-day.cdp-selected.cdp-off-day {
    background: #0D882C;
    color: white;
    border-color: #0D882C;
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */

.cdp-day[aria-selected="true"] {
    font-weight: bold;
}

/* Focus visible for keyboard navigation */
.cdp-calendar:focus-within .cdp-day:focus {
    box-shadow: 0 0 0 3px rgba(13, 136, 44, 0.4);
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 480px) {
    /* Phones: grow the cells for touch instead of shrinking them (they were
       28px / 11px here before 2026-11-08). 7 × 40px + gaps ≈ 308px, which
       still fits a 320px-wide screen because the calendar is fit-content. */
    .cdp-day {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .cdp-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .cdp-current-month-year {
        font-size: 13px;
    }
}

/* ===================================================================
   DARK MODE
   =================================================================== */

@media (prefers-color-scheme: dark) {
    .cdp-calendar {
        background: #343a40;
        border-color: #6c757d;
        color: #f8f9fa;
    }
    
    .cdp-header {
        background-color: #495057;
        border-bottom-color: #6c757d;
    }
    
    .cdp-nav-btn {
        background: #495057;
        border-color: #6c757d;
        color: #f8f9fa;
    }
    
    .cdp-nav-btn:hover {
        background: #0D882C;
        border-color: #0D882C;
    }
    
    .cdp-current-month-year {
        color: #f8f9fa;
    }
    
    .cdp-weekday {
        color: #adb5bd;
    }
    
    .cdp-weekdays {
        border-bottom-color: #6c757d;
    }
    
    .cdp-day {
        background: #495057;
        border-color: #6c757d;
        color: #f8f9fa;
    }
    
    .cdp-day:hover:not(.cdp-disabled) {
        background: #6c757d;
    }
    
    .cdp-day.cdp-other-month {
        background: #343a40;
        color: #6c757d;
    }
    
    .cdp-day.cdp-disabled {
        background: #343a40;
        color: #495057;
    }
    
    .cdp-day.cdp-today {
        background: #856404;
        color: #fff3cd;
        border-color: #ffc107;
    }
    
    .cdp-day.cdp-selected {
        background: #0D882C;
        color: white;
    }
    
    .cdp-day.cdp-weekend {
        color: #f8bfc4;
    }
    
    .cdp-day.cdp-off-day {
        background-color: #5a1f1f;
        color: #ffcccc;
    }
    
    .cdp-day.cdp-off-day:hover:not(.cdp-disabled) {
        background-color: #6e2828;
    }
    
    .cdp-day.cdp-off-day.cdp-other-month {
        background-color: #3d1515;
        color: #8b6666;
    }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    .cdp-calendar {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cdp-nav-btn {
        display: none;
    }
}
