/* ============================================
   RSL Date Picker Component
   Version: 2.0.0
   Description: Premium accessible date picker with
   single date, date range, and multiple date selection.
   Full ADA/WCAG 2.1 AA compliant with keyboard navigation,
   screen reader support, and live announcements.
   A flagship RSL component for form interactions.

   FilterBus Integration (v2.0.0):
   - Visual indicators when publishing to FilterBus
   - Active state highlighting for filtered date selection
   ============================================ */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Base colors */
    --rsl-dp-bg: #ffffff;
    --rsl-dp-bg-secondary: #f8fafc;
    --rsl-dp-border: #e2e8f0;
    --rsl-dp-border-focus: #6E7BFF;
    --rsl-dp-text: #1e293b;
    --rsl-dp-text-muted: #64748b;
    --rsl-dp-text-light: #94a3b8;

    /* Primary accent */
    --rsl-dp-primary: #6E7BFF;
    --rsl-dp-primary-hover: #5a67d8;
    --rsl-dp-primary-light: rgba(110, 123, 255, 0.1);
    --rsl-dp-primary-lighter: rgba(110, 123, 255, 0.05);

    /* Selection colors */
    --rsl-dp-selected-bg: #6E7BFF;
    --rsl-dp-selected-text: #ffffff;
    --rsl-dp-range-bg: rgba(110, 123, 255, 0.15);
    --rsl-dp-range-edge-bg: #6E7BFF;
    --rsl-dp-hover-bg: rgba(110, 123, 255, 0.1);

    /* Today indicator */
    --rsl-dp-today-border: #6E7BFF;
    --rsl-dp-today-bg: transparent;

    /* Disabled states */
    --rsl-dp-disabled-text: #cbd5e1;
    --rsl-dp-disabled-bg: #f8fafc;

    /* Shadows */
    --rsl-dp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rsl-dp-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -5px rgba(0, 0, 0, 0.04);
    --rsl-dp-shadow-focus: 0 0 0 3px rgba(110, 123, 255, 0.2);

    /* Dimensions */
    --rsl-dp-input-height: 44px;
    --rsl-dp-day-size: 40px;
    --rsl-dp-border-radius: 8px;
    --rsl-dp-border-radius-lg: 12px;
    --rsl-dp-popover-width: 320px;
    --rsl-dp-popover-width-dual: 640px;

    /* Z-index */
    --rsl-dp-z-index: 1000;

    /* Animation timing */
    --rsl-dp-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --rsl-dp-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Container & Input Wrapper
   ============================================ */
.rsl-date-picker {
    position: relative;
    display: inline-block;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.rsl-date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Range mode: two inputs side by side */
.rsl-date-picker[data-mode="range"] .rsl-date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rsl-date-picker-separator {
    color: var(--rsl-dp-text-muted);
    font-weight: 500;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.rsl-date-picker-separator svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Input Field Group
   ============================================ */
.rsl-date-picker-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.rsl-date-picker-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rsl-dp-text);
}

.rsl-date-picker-label.required::after {
    content: " *";
    color: #ef4444;
}

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

/* ============================================
   Input Field
   ============================================ */
.rsl-date-picker-input {
    width: 100%;
    height: var(--rsl-dp-input-height);
    padding: 0.625rem 2.75rem 0.625rem 1rem;
    background: var(--rsl-dp-bg);
    border: 2px solid var(--rsl-dp-border);
    border-radius: var(--rsl-dp-border-radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--rsl-dp-text);
    transition: border-color var(--rsl-dp-transition), box-shadow var(--rsl-dp-transition);
    outline: none;
    cursor: pointer;
}

.rsl-date-picker-input::placeholder {
    color: var(--rsl-dp-text-light);
}

.rsl-date-picker-input:hover {
    border-color: var(--rsl-dp-primary);
}

.rsl-date-picker-input:focus {
    border-color: var(--rsl-dp-border-focus);
    box-shadow: var(--rsl-dp-shadow-focus);
}

.rsl-date-picker-input:disabled {
    background: var(--rsl-dp-disabled-bg);
    color: var(--rsl-dp-disabled-text);
    cursor: not-allowed;
}

.rsl-date-picker-input[aria-invalid="true"] {
    border-color: #ef4444;
}

.rsl-date-picker-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ============================================
   Calendar Trigger Button
   ============================================ */
.rsl-date-picker-trigger {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--rsl-dp-text-muted);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-trigger:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-trigger:focus {
    outline: none;
    background: var(--rsl-dp-primary-light);
    color: var(--rsl-dp-primary);
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
}

.rsl-date-picker-trigger:focus:not(:focus-visible) {
    box-shadow: none;
}

.rsl-date-picker-trigger:focus-visible {
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
}

.rsl-date-picker-trigger svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Clear Button (inline in input)
   ============================================ */
.rsl-date-picker-clear {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--rsl-dp-text-light);
    border: none;
    border-radius: 50%;
    color: var(--rsl-dp-bg);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-clear:hover {
    background: #ef4444;
    color: white;
}

.rsl-date-picker-clear:focus {
    outline: none;
    background: #ef4444;
    color: white;
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px #ef4444;
}

.rsl-date-picker-clear:focus:not(:focus-visible) {
    box-shadow: none;
}

.rsl-date-picker-clear:focus-visible {
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px #ef4444;
}

.rsl-date-picker-clear svg {
    width: 14px;
    height: 14px;
}

/* Adjust input padding when clear button is present */
.rsl-date-picker-input-group:has(.rsl-date-picker-clear) .rsl-date-picker-input {
    padding-right: 4.5rem;
}

/* ============================================
   Popover Container
   ============================================ */
.rsl-date-picker-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: var(--rsl-dp-z-index);
    display: none;
    width: var(--rsl-dp-popover-width);
    background: var(--rsl-dp-bg);
    border: 1px solid var(--rsl-dp-border);
    border-radius: var(--rsl-dp-border-radius-lg);
    box-shadow: var(--rsl-dp-shadow-lg);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--rsl-dp-transition), transform var(--rsl-dp-transition);
}

.rsl-date-picker-popover.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Close button */
.rsl-date-picker-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--rsl-dp-text-light);
    cursor: pointer;
    transition: background var(--rsl-dp-transition-fast), color var(--rsl-dp-transition-fast);
}

.rsl-date-picker-close:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-text);
}

.rsl-date-picker-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--rsl-dp-primary);
}

.rsl-date-picker-close:focus:not(:focus-visible) {
    box-shadow: none;
}

.rsl-date-picker-close:focus-visible {
    box-shadow: 0 0 0 2px var(--rsl-dp-primary);
}

.rsl-date-picker-close svg {
    width: 16px;
    height: 16px;
}

/* Dual calendar mode (range picker) */
.rsl-date-picker[data-show-dual-calendar="true"] .rsl-date-picker-popover {
    width: var(--rsl-dp-popover-width-dual);
}

/* With presets panel */
.rsl-date-picker[data-presets] .rsl-date-picker-popover {
    display: none;
}

.rsl-date-picker[data-presets] .rsl-date-picker-popover.open {
    display: flex;
}

/* Inline mode */
.rsl-date-picker[data-inline="true"] .rsl-date-picker-popover {
    position: static;
    display: block;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--rsl-dp-border);
}

/* ============================================
   Presets Panel
   ============================================ */
.rsl-date-picker-presets {
    flex-shrink: 0;
    width: 140px;
    padding: 0.75rem;
    background: var(--rsl-dp-bg-secondary);
    border-right: 1px solid var(--rsl-dp-border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rsl-date-picker-presets-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rsl-dp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.rsl-date-picker-preset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--rsl-dp-text);
    text-align: left;
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-preset:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-preset:focus {
    outline: none;
    background: var(--rsl-dp-primary-light);
    color: var(--rsl-dp-primary);
    box-shadow: inset 0 0 0 2px var(--rsl-dp-primary);
}

.rsl-date-picker-preset[aria-pressed="true"],
.rsl-date-picker-preset.active {
    background: var(--rsl-dp-primary);
    color: var(--rsl-dp-selected-text);
}

.rsl-date-picker-preset-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ============================================
   Calendar Panel
   ============================================ */
.rsl-date-picker-calendar-panel {
    flex: 1;
    padding: 1rem;
    min-width: 0;
}

/* ============================================
   Calendar Header (Month/Year Navigation)
   ============================================ */
.rsl-date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.rsl-date-picker-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rsl-date-picker-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--rsl-dp-text);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-nav-btn:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-nav-btn:focus {
    outline: none;
    background: var(--rsl-dp-primary-light);
    color: var(--rsl-dp-primary);
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
}

.rsl-date-picker-nav-btn:disabled {
    color: var(--rsl-dp-disabled-text);
    cursor: not-allowed;
    background: transparent;
}

.rsl-date-picker-nav-btn svg {
    width: 20px;
    height: 20px;
}

.rsl-date-picker-title {
    flex: 1;
    text-align: center;
}

.rsl-date-picker-month-year {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rsl-dp-text);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-month-year:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-month-year:focus {
    outline: none;
    background: var(--rsl-dp-primary-light);
    color: var(--rsl-dp-primary);
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
}

/* ============================================
   Dual Calendar Layout
   ============================================ */
.rsl-date-picker-calendars {
    display: flex;
    gap: 1.5rem;
}

.rsl-date-picker-calendar {
    flex: 1;
    min-width: 0;
}

.rsl-date-picker-calendar + .rsl-date-picker-calendar {
    padding-left: 1.5rem;
    border-left: 1px solid var(--rsl-dp-border);
}

/* ============================================
   Calendar Grid
   ============================================ */
.rsl-date-picker-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.rsl-date-picker-weekdays {
    margin-bottom: 0.5rem;
}

.rsl-date-picker-weekday {
    padding: 0.5rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rsl-dp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.rsl-date-picker-week {
    display: table-row;
}

.rsl-date-picker-day {
    padding: 2px;
    text-align: center;
    vertical-align: middle;
    border: none !important; /* Override tables.css and modern-theme.css */
}

/* Override any inherited table styles from tables.css and modern-theme.css */
.rsl-date-picker-calendar th,
.rsl-date-picker-calendar td,
.rsl-date-picker th,
.rsl-date-picker td {
    border: none !important;
    border-color: transparent !important;
    background: transparent;
}

/* ============================================
   Day Button
   ============================================ */
.rsl-date-picker-day-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--rsl-dp-day-size);
    height: var(--rsl-dp-day-size);
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50%;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rsl-dp-text);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
    position: relative;
}

.rsl-date-picker-day-btn:hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-day-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
    z-index: 1;
}

.rsl-date-picker-day-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

.rsl-date-picker-day-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
    z-index: 1;
}

/* Today indicator */
.rsl-date-picker-day-btn[aria-current="date"] {
    border-color: var(--rsl-dp-today-border);
    font-weight: 700;
}

/* Selected state */
.rsl-date-picker-day-btn[aria-selected="true"] {
    background: var(--rsl-dp-selected-bg);
    color: var(--rsl-dp-selected-text);
    border-color: var(--rsl-dp-selected-bg);
    font-weight: 600;
}

.rsl-date-picker-day-btn[aria-selected="true"]:hover {
    background: var(--rsl-dp-primary-hover);
    border-color: var(--rsl-dp-primary-hover);
}

/* Range: in-between dates */
.rsl-date-picker-day.in-range .rsl-date-picker-day-btn {
    background: var(--rsl-dp-range-bg);
    border-radius: 0;
}

.rsl-date-picker-day.in-range:first-child .rsl-date-picker-day-btn,
.rsl-date-picker-day.range-start .rsl-date-picker-day-btn {
    border-radius: 50% 0 0 50%;
}

.rsl-date-picker-day.in-range:last-child .rsl-date-picker-day-btn,
.rsl-date-picker-day.range-end .rsl-date-picker-day-btn {
    border-radius: 0 50% 50% 0;
}

.rsl-date-picker-day.range-start.range-end .rsl-date-picker-day-btn {
    border-radius: 50%;
}

/* Range start/end markers */
.rsl-date-picker-day.range-start .rsl-date-picker-day-btn,
.rsl-date-picker-day.range-end .rsl-date-picker-day-btn {
    background: var(--rsl-dp-range-edge-bg);
    color: var(--rsl-dp-selected-text);
}

/* Disabled dates */
.rsl-date-picker-day-btn:disabled,
.rsl-date-picker-day-btn[aria-disabled="true"] {
    color: var(--rsl-dp-disabled-text);
    cursor: not-allowed;
    text-decoration: line-through;
}

.rsl-date-picker-day-btn[aria-disabled="true"]:hover {
    background: transparent;
}

/* Other month's dates */
.rsl-date-picker-day.other-month .rsl-date-picker-day-btn {
    color: var(--rsl-dp-text-light);
    opacity: 0.5;
}

/* ============================================
   Month/Year Picker Modal
   ============================================ */
.rsl-date-picker-month-picker,
.rsl-date-picker-year-picker {
    display: none;
    padding: 1rem;
}

.rsl-date-picker-month-picker.open,
.rsl-date-picker-year-picker.open {
    display: block;
}

.rsl-date-picker-months-grid,
.rsl-date-picker-years-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.rsl-date-picker-month-btn,
.rsl-date-picker-year-btn {
    padding: 0.75rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rsl-dp-text);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-month-btn:hover,
.rsl-date-picker-year-btn:hover {
    background: var(--rsl-dp-hover-bg);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-month-btn:focus,
.rsl-date-picker-year-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--rsl-dp-bg), 0 0 0 4px var(--rsl-dp-primary);
}

.rsl-date-picker-month-btn[aria-selected="true"],
.rsl-date-picker-year-btn[aria-selected="true"] {
    background: var(--rsl-dp-selected-bg);
    color: var(--rsl-dp-selected-text);
}

.rsl-date-picker-month-btn[aria-current="true"],
.rsl-date-picker-year-btn[aria-current="true"] {
    border-color: var(--rsl-dp-primary);
}

/* ============================================
   Footer (Summary & Actions)
   ============================================ */
.rsl-date-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--rsl-dp-bg-secondary);
    border-top: 1px solid var(--rsl-dp-border);
}

.rsl-date-picker-summary {
    flex: 1;
    font-size: 0.875rem;
    color: var(--rsl-dp-text);
    min-width: 0;
}

.rsl-date-picker-summary-range {
    font-weight: 600;
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-summary-days {
    color: var(--rsl-dp-text-muted);
    margin-left: 0.5rem;
}

.rsl-date-picker-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.rsl-date-picker-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--rsl-dp-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rsl-dp-text);
    cursor: pointer;
    transition: all var(--rsl-dp-transition-fast);
}

.rsl-date-picker-btn:hover {
    background: var(--rsl-dp-hover-bg);
    border-color: var(--rsl-dp-primary);
    color: var(--rsl-dp-primary);
}

.rsl-date-picker-btn:focus {
    outline: none;
    border-color: var(--rsl-dp-primary);
    box-shadow: var(--rsl-dp-shadow-focus);
}

.rsl-date-picker-btn-primary {
    background: var(--rsl-dp-primary);
    border-color: var(--rsl-dp-primary);
    color: var(--rsl-dp-selected-text);
}

.rsl-date-picker-btn-primary:hover {
    background: var(--rsl-dp-primary-hover);
    border-color: var(--rsl-dp-primary-hover);
    color: var(--rsl-dp-selected-text);
}

/* ============================================
   Error State
   ============================================ */
.rsl-date-picker-error {
    display: none;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #ef4444;
}

.rsl-date-picker-error.visible {
    display: block;
}

.rsl-date-picker-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--rsl-dp-text-muted);
}

/* ============================================
   Screen Reader Only (Live Region)
   ============================================ */
.rsl-date-picker-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Size Variants
   ============================================ */
.rsl-date-picker-sm .rsl-date-picker-input {
    height: 36px;
    font-size: 0.875rem;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}

.rsl-date-picker-sm .rsl-date-picker-trigger {
    width: 28px;
    height: 28px;
}

.rsl-date-picker-sm .rsl-date-picker-trigger svg {
    width: 16px;
    height: 16px;
}

.rsl-date-picker-lg .rsl-date-picker-input {
    height: 52px;
    font-size: 1.125rem;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
}

.rsl-date-picker-lg .rsl-date-picker-trigger {
    width: 40px;
    height: 40px;
}

.rsl-date-picker-lg .rsl-date-picker-trigger svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   Theme Variants
   ============================================ */
.rsl-date-picker-rounded .rsl-date-picker-input,
.rsl-date-picker-rounded .rsl-date-picker-popover {
    border-radius: 9999px;
}

.rsl-date-picker-rounded .rsl-date-picker-popover {
    border-radius: 20px;
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] .rsl-date-picker,
.rsl-date-picker[data-theme="dark"] {
    --rsl-dp-bg: #1e293b;
    --rsl-dp-bg-secondary: #0f172a;
    --rsl-dp-border: #334155;
    --rsl-dp-text: #f1f5f9;
    --rsl-dp-text-muted: #94a3b8;
    --rsl-dp-text-light: #64748b;
    --rsl-dp-disabled-text: #475569;
    --rsl-dp-disabled-bg: #1e293b;
    --rsl-dp-hover-bg: rgba(110, 123, 255, 0.15);
    --rsl-dp-range-bg: rgba(110, 123, 255, 0.2);
    --rsl-dp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --rsl-dp-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .rsl-date-picker,
    .rsl-date-picker * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .rsl-date-picker-popover {
        transform: none !important;
    }
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .rsl-date-picker-popover {
        position: fixed;
        top: auto !important;
        bottom: 0;
        left: 0 !important;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: var(--rsl-dp-border-radius-lg) var(--rsl-dp-border-radius-lg) 0 0;
        max-height: 80vh;
        overflow-y: auto;
        transform: translateY(100%);
    }

    .rsl-date-picker-popover.open {
        transform: translateY(0);
    }

    .rsl-date-picker[data-show-dual-calendar="true"] .rsl-date-picker-popover {
        width: 100%;
    }

    .rsl-date-picker-calendars {
        flex-direction: column;
        gap: 1rem;
    }

    .rsl-date-picker-calendar + .rsl-date-picker-calendar {
        padding-left: 0;
        padding-top: 1rem;
        border-left: none;
        border-top: 1px solid var(--rsl-dp-border);
    }

    .rsl-date-picker[data-presets] .rsl-date-picker-popover.open {
        flex-direction: column;
    }

    .rsl-date-picker-presets {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--rsl-dp-border);
        padding: 0.5rem;
    }

    .rsl-date-picker-presets-title {
        width: 100%;
    }

    .rsl-date-picker-preset {
        flex: 1 1 auto;
        min-width: fit-content;
        justify-content: center;
    }

    .rsl-date-picker[data-mode="range"] .rsl-date-picker-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }

    .rsl-date-picker-separator {
        display: none;
    }

    .rsl-date-picker-field {
        width: 100%;
    }

    /* Larger touch targets on mobile */
    .rsl-date-picker-day-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .rsl-date-picker-nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .rsl-date-picker-popover {
        display: none !important;
    }

    .rsl-date-picker-trigger {
        display: none;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (forced-colors: active) {
    .rsl-date-picker-input,
    .rsl-date-picker-day-btn,
    .rsl-date-picker-nav-btn,
    .rsl-date-picker-preset,
    .rsl-date-picker-btn {
        forced-color-adjust: none;
    }

    .rsl-date-picker-day-btn[aria-selected="true"] {
        background: Highlight;
        color: HighlightText;
    }

    .rsl-date-picker-day-btn:focus {
        outline: 2px solid Highlight;
    }
}

/* ============================================
   FilterBus Integration (v2.0.0)
   Date picker is a publish-only component.
   It publishes date selection to FilterBus but
   does not subscribe to external filter state.
   ============================================ */

/* Visual indicator when FilterBus is active */
.rsl-date-picker[data-filterbus-publish] .rsl-date-picker-input {
    transition: border-color var(--rsl-dp-transition), box-shadow var(--rsl-dp-transition);
}

/* Highlight on date selection when publishing */
.rsl-date-picker[data-filterbus-publish][data-filterbus-active="true"] .rsl-date-picker-input {
    border-color: var(--rsl-dp-primary);
    box-shadow: var(--rsl-dp-shadow-focus);
}

/* FilterBus status indicator */
.rsl-date-picker[data-filterbus-publish]::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(calc(100% + 8px));
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--rsl-dp-disabled-text);
    opacity: 0;
    transition: opacity var(--rsl-dp-transition), background-color var(--rsl-dp-transition);
}

/* Show indicator when FilterBus value is set */
.rsl-date-picker[data-filterbus-publish][data-filterbus-active="true"]::after {
    opacity: 1;
    background-color: var(--rsl-dp-primary);
}
