/* =======================
   DATE PICKER CUSTOM STYLES 
   (Replacing Tailwind CSS classes)
   ======================= */

/* Layout utilities */
.dp-flex { display: flex; }
.dp-items-center { align-items: center; }
.dp-justify-between { justify-content: space-between; }
.dp-justify-center { justify-content: center; }
.dp-items-start { align-items: flex-start; }
.dp-flex-1 { flex: 1; }
.dp-w-full { width: 100%; }
.dp-h-6 { height: 1.5rem; }
.dp-w-6 { width: 1.5rem; }
.dp-mx-auto { margin-left: auto; margin-right: auto; }
.dp-text-center { text-align: center; }

/* Grid utilities */
.dp-grid { display: grid; }
.dp-grid-cols-7 { grid-template-columns: repeat(7, 1fr); }

/* Spacing utilities */
.dp-gap-0\.5 { gap: 0.125rem; }
.dp-gap-3 { gap: 0.75rem; }
.dp-mb-1 { margin-bottom: 0.25rem; }
.dp-mb-2 { margin-bottom: 0.5rem; }
.dp-py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.dp-p-2 { padding: 0.5rem; }
.dp-p-3 { padding: 0.75rem; }

/* Max width utilities */
.dp-max-w-245 { max-width: 245px; }

/* Text sizing utilities */
.dp-text-xs { font-size: 0.75rem; line-height: 1rem; }
.dp-text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.dp-text-9px { font-size: 9px; }
.dp-text-10px { font-size: 10px; }

/* Font weight utilities */
.dp-font-medium { font-weight: 500; }
.dp-font-semibold { font-weight: 600; }

/* Text transform utilities */
.dp-uppercase { text-transform: uppercase; }

/* Border radius utilities */
.dp-rounded-full { border-radius: 9999px; }

/* Transition utilities */
.dp-transition-all { 
    transition-property: all; 
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 
    transition-duration: 150ms; 
}

/* Cursor utilities */
.dp-cursor-pointer { cursor: pointer; }
.dp-cursor-not-allowed { cursor: not-allowed; }

/* Display utilities */
.dp-block { display: block; }
.dp-inline-block { display: inline-block; }

/* Responsive utilities for mobile */
@media (max-width: 768px) {
    .dp-mobile-p-2 { padding: 0.5rem; }
    .dp-mobile-max-w-245 { max-width: 245px; }
}

/* =======================
   VANILLA JS DATE PICKER STYLES
   ======================= */

/* Date picker backdrop for mobile */
.date-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* Main date picker container */
#date-picker-calendar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    width: 320px;
    max-width: 90vw;
    font-family: var(--font-family);
    overflow: hidden;
    opacity: 0.9;
}

.date-picker-container {
    padding: 0;
}

/* Header with date fields */
.date-picker-header {
    padding: 12px 16px 10px 16px;
    border-bottom: 1px solid #ebebeb;
    background: #ffffff;
}

.date-picker-fields {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
}

.date-field-group {
    flex: 1;
    text-align: center;
    max-width: 120px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.date-field-group.active {
    background: #f7f7f7;
    border: 1px solid #222222;
}

.date-field-group.active .date-field-label {
    color: #222222;
}

.date-field-group.active .date-field-value {
    color: #222222;
}

.date-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #222222;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 2px 0;
    display: block;
}

.date-field-value {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    padding: 2px 0;
    line-height: 1.2;
}

.date-field-value:empty::before {
    content: 'Add date';
    color: #717171;
    font-weight: 400;
}

/* Month navigation */
.date-picker-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ebebeb;
}

.month-nav-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #222222;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover {
    background: #f7f7f7;
}

.month-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    flex: 1;
    text-align: center;
}

/* Calendar */
.date-picker-calendar {
    padding: 16px 20px;
}

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

.calendar-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #717171;
    padding: 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.calendar-day:not(.empty):not(.past):hover {
    background: #f0f0f0;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.past {
    color: #222222;
    cursor: default;
    background: #fafafa;
    opacity: 0.4;
    pointer-events: none;
}

.calendar-day.before-checkin {
    color: #222222;
    cursor: default;
    background: #fafafa;
    opacity: 0.4;
    pointer-events: none;
}

.calendar-day.today {
    border: 2px solid #222222;
    font-weight: 600;
}

.calendar-day.check-in {
    background: #222222;
    color: #ffffff;
    font-weight: 600;
}

.calendar-day.check-out {
    background: #222222;
    color: #ffffff;
    font-weight: 600;
}

.calendar-day.in-range {
    background: #f0f0f0;
    color: #222222;
}

/* Footer styles removed - no longer needed */

/* Mobile responsive */
@media (max-width: 768px) {
    #date-picker-calendar {
        width: 300px;
        max-width: 85vw;
    }
    
    .date-picker-header {
        padding: 10px 14px 8px 14px;
    }
    
    .date-picker-fields {
        gap: 10px;
    }
    
    .date-field-group {
        max-width: 100px;
        padding: 3px 6px;
    }
    
    .date-field-label {
        font-size: 11px;
    }
    
    .date-field-value {
        font-size: 15px;
        padding: 1px 0;
    }
    
    .date-picker-month-nav,
    .date-picker-calendar {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .month-nav-title {
        font-size: 15px;
    }
    
    .calendar-day {
        font-size: 13px;
    }
    
    .calendar-day-name {
        font-size: 11px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    #date-picker-calendar {
        width: 280px;
        max-width: 90vw;
    }
    
    .date-picker-header {
        padding: 8px 12px 6px 12px;
    }
    
    .date-picker-fields {
        gap: 8px;
    }
    
    .date-field-group {
        max-width: 90px;
        padding: 2px 4px;
    }
    
    .date-field-label {
        font-size: 10px;
    }
    
    .date-field-value {
        font-size: 14px;
        padding: 1px 0;
    }
    
    .date-picker-month-nav,
    .date-picker-calendar {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Animation */
@keyframes datePickerFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#date-picker-calendar {
    animation: datePickerFadeIn 0.2s ease-out;
}
