/* Date Range Picker - Dark theme glassmorphism style */

.date-range-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1080;  /* Match modal z-index for proper layering */
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.date-range-picker {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 720px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date-range-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.date-range-picker-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

.date-range-picker-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.date-range-picker-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.date-range-picker-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Responsive Styles - Medium screens (tablets) */
@media (max-width: 768px) {
    .date-range-picker {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
        margin: 1rem;
    }

    .date-range-picker-body {
        /* Keep side by side on medium screens - panels have 270px min-width */
        flex-wrap: wrap;
        padding: 1rem;
        gap: 1rem;
    }

    .date-range-picker-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: rgba(30, 30, 50, 0.98);
        z-index: 10;
    }

    .date-range-picker-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: rgba(30, 30, 50, 0.98);
    }

    .date-range-picker-footer .retention-hint {
        text-align: center;
    }

    .date-range-picker-actions {
        width: 100%;
        justify-content: stretch;
    }

    .date-range-picker-actions .btn {
        flex: 1;
    }
}

/* Stack panels only on very small screens */
@media (max-width: 600px) {
    .date-range-picker-body {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .date-range-picker {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .date-range-picker-header h4 {
        font-size: 1rem;
    }

    .date-panel {
        min-width: auto;
    }

    .calendar-day {
        font-size: 0.75rem;
    }

    .calendar-weekdays span {
        font-size: 0.65rem;
    }

    .time-inputs select {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Date Panel */
.date-panel {
    flex: 1;
    min-width: 270px;
}

/* Stack panels only on very small screens (less than 600px = 270px * 2 + gaps + padding) */
@media (max-width: 600px) {
    .date-panel {
        min-width: auto;
        width: 100%;
    }
}

.date-panel-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.date-panel-display {
    background: rgba(40, 40, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 1rem;
}

/* Hide the native browser calendar picker icon - we use our own calendar */
.date-panel-display::-webkit-calendar-picker-indicator {
    display: none;
}
.date-panel-display::-webkit-inner-spin-button {
    display: none;
}

/* Calendar */
.calendar-container {
    background: rgba(40, 40, 60, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
}

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

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

.calendar-nav {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.calendar-weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    padding: 0.25rem;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    background: rgba(113, 44, 249, 0.2);
    color: #fff;
}

.calendar-day.other-month {
    color: rgba(255, 255, 255, 0.25);
}

.calendar-day.disabled {
    color: rgba(255, 255, 255, 0.15);
    cursor: not-allowed;
}

.calendar-day.today {
    background: rgba(113, 44, 249, 0.15);
    border: 1px solid rgba(113, 44, 249, 0.4);
}

.calendar-day.selected {
    background: #712cf9;
    color: #fff;
    font-weight: 600;
}

.calendar-day.selected:hover {
    background: #8244ff;
}

/* Footer */
.date-range-picker-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.retention-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.date-range-picker-actions {
    display: flex;
    gap: 0.75rem;
}

.date-range-picker-actions .btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.date-range-picker-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.date-range-picker-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.date-range-picker-actions .btn-primary {
    background: linear-gradient(135deg, #712cf9, #5a23c8);
    border: none;
    color: #fff;
}

.date-range-picker-actions .btn-primary:hover {
    background: linear-gradient(135deg, #8244ff, #6b2ee0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(113, 44, 249, 0.4);
}

/* Calendar button trigger styling */
.date-picker-trigger {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.date-picker-trigger:hover {
    background: rgba(113, 44, 249, 0.15);
    border-color: rgba(113, 44, 249, 0.4);
    color: #fff;
}

/* Custom date display */
.custom-date-display {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Time range selector container */
.time-range-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
