/* ================================================
   ARCADE SELECT DROPDOWN & DATETIME CALENDAR 🎮
   Styling for select dropdowns and datetime picker popups
================================================ */

/* -------------------------------------------
   SELECT DROPDOWN STYLING
------------------------------------------- */

select.form-select,
select.form-select-sm,
select.cp-select {
    /* Base styling */
    padding: 0.65rem 2.5rem 0.65rem 1rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    font-family: 'Rubik', -apple-system, sans-serif !important;
    
    /* Arcade colors — border and glow match .dropdown-menu (admin dropdown) */
    background: linear-gradient(135deg, var(--cp-bg-2) 0%, var(--cp-bg-3) 100%) !important;
    color: var(--cp-text) !important;
    border: 2px solid var(--cp-brand) !important;
    border-radius: 10px !important;
    
    /* Custom arrow */
    background-image: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    /* Effects — same shadow stack as .dropdown-menu */
    box-shadow: 
        0 0 20px var(--cp-brand-glow),
        0 10px 30px rgba(0, 0, 0, 0.5) !important;
    transition: all 200ms ease !important;
    
    cursor: pointer !important;
}

/* Custom dropdown arrow */
select.form-select::after,
select.form-select-sm::after,
select.cp-select::after {
    content: '▼' !important;
    position: absolute !important;
    right: 1rem !important;
    pointer-events: none !important;
    color: var(--cp-brand) !important;
}

/* Add arrow using background gradient trick */
select.form-select,
select.form-select-sm,
select.cp-select {
    background-image: 
        linear-gradient(135deg, var(--cp-bg-2) 0%, var(--cp-bg-3) 100%),
        linear-gradient(45deg, transparent 50%, var(--cp-brand) 50%),
        linear-gradient(135deg, var(--cp-brand) 50%, transparent 50%) !important;
    background-position: 
        calc(100% - 0px) calc(100% - 0px),
        calc(100% - 15px) calc(1em + 2px),
        calc(100% - 10px) calc(1em + 2px) !important;
    background-size: 
        100% 100%,
        5px 5px,
        5px 5px !important;
    background-repeat: no-repeat !important;
}

/* Hover state — intensified glow */
select.form-select:hover,
select.form-select-sm:hover,
select.cp-select:hover {
    border-color: var(--cp-brand) !important;
    box-shadow: 
        0 0 28px var(--cp-brand-glow),
        0 12px 36px rgba(0, 0, 0, 0.5),
        inset 0 0 10px rgba(0, 217, 255, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Focus state */
select.form-select:focus,
select.form-select-sm:focus,
select.cp-select:focus {
    border-color: var(--cp-brand) !important;
    background: var(--cp-bg-3) !important;
    box-shadow: 
        0 0 0 3px rgba(0, 217, 255, 0.25),
        0 0 28px var(--cp-brand-glow),
        0 12px 36px rgba(0, 0, 0, 0.5),
        inset 0 0 10px rgba(0, 217, 255, 0.3) !important;
    outline: none !important;
}

/* Small variant */
select.form-select-sm {
    padding: 0.45rem 2rem 0.45rem 0.75rem !important;
    font-size: 0.875rem !important;
    border-radius: 8px !important;
}

/* -------------------------------------------
   SELECT OPTIONS (Limited Browser Support)
------------------------------------------- */

/* Chrome/Edge support for styling options */
select.form-select option,
select.form-select-sm option,
select.cp-select option {
    background: var(--cp-bg-2) !important;
    color: var(--cp-text) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
}

select.form-select option:hover,
select.form-select-sm option:hover,
select.cp-select option:hover {
    background: var(--cp-brand) !important;
    color: #000 !important;
}

select.form-select option:checked,
select.form-select-sm option:checked,
select.cp-select option:checked {
    background: linear-gradient(135deg, var(--cp-brand) 0%, #0099cc 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
}

/* -------------------------------------------
   DATETIME PICKER CALENDAR POPUP
   (Very Limited Browser Support - Chrome/Edge Only)
------------------------------------------- */

/* Webkit/Blink Calendar Picker Styling */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: brightness(0) saturate(100%) invert(62%) sepia(89%) saturate(2527%) hue-rotate(161deg) brightness(101%) contrast(101%);
    opacity: 0.8;
    transition: all 150ms ease;
    padding: 8px;
    margin-left: 8px;
    border-radius: 6px;
    background: rgba(0, 217, 255, 0.1);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 10px var(--cp-brand-glow);
    transform: scale(1.1);
}

/* Calendar popup (Chrome/Edge specific - experimental) */
::-webkit-datetime-edit-fields-wrapper {
    background: transparent !important;
}

::-webkit-datetime-edit {
    color: var(--cp-brand) !important;
    padding: 0 !important;
}

::-webkit-datetime-edit-text {
    color: var(--cp-text-3) !important;
    padding: 0 0.25em !important;
}

::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-year-field,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-ampm-field {
    color: var(--cp-brand) !important;
    background: transparent !important;
    padding: 0.1em 0.2em !important;
    border-radius: 3px !important;
    font-weight: 700 !important;
}

::-webkit-datetime-edit-month-field:focus,
::-webkit-datetime-edit-day-field:focus,
::-webkit-datetime-edit-year-field:focus,
::-webkit-datetime-edit-hour-field:focus,
::-webkit-datetime-edit-minute-field:focus,
::-webkit-datetime-edit-ampm-field:focus {
    background: rgba(0, 217, 255, 0.2) !important;
    color: #00ffff !important;
    outline: none !important;
}

/* -------------------------------------------
   DISABLED STATE
------------------------------------------- */

select.form-select:disabled,
select.form-select-sm:disabled,
select.cp-select:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.8) !important;
}

select.form-select:disabled:hover,
select.form-select-sm:disabled:hover,
select.cp-select:disabled:hover {
    transform: none !important;
    border-color: var(--cp-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* -------------------------------------------
   LABEL STYLING FOR SELECTS
------------------------------------------- */

label.cp-label-muted {
    color: var(--cp-text-2) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.5rem !important;
}

/* -------------------------------------------
   MOBILE RESPONSIVE
------------------------------------------- */

@media (max-width: 576px) {
    select.form-select,
    select.cp-select {
        padding: 0.55rem 2.25rem 0.55rem 0.875rem !important;
        font-size: 0.9rem !important;
    }
    
    select.form-select-sm {
        padding: 0.4rem 1.75rem 0.4rem 0.65rem !important;
        font-size: 0.85rem !important;
    }
}

/* -------------------------------------------
   BROWSER-SPECIFIC FIXES
------------------------------------------- */

/* Firefox */
@-moz-document url-prefix() {
    select.form-select,
    select.form-select-sm,
    select.cp-select {
        padding-right: 2rem !important;
        background-image: 
            linear-gradient(135deg, var(--cp-bg-2) 0%, var(--cp-bg-3) 100%) !important;
        border-color: var(--cp-brand) !important;
    }
}

/* Safari */
@supports (-webkit-appearance: none) {
    select.form-select,
    select.form-select-sm,
    select.cp-select {
        padding-right: 2.5rem !important;
    }
}

/* -------------------------------------------
   SPECIAL: Status Dropdown on Details Page
------------------------------------------- */

/* Specific styling for status dropdown */
form[action*="UpdateStatus"] select {
    background: linear-gradient(135deg, var(--cp-bg-2) 0%, var(--cp-bg-3) 100%) !important;
    border: 2px solid var(--cp-brand) !important;
    color: var(--cp-text) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

form[action*="UpdateStatus"] select:hover {
    border-color: var(--cp-brand) !important;
    box-shadow: 0 0 15px var(--cp-brand-glow) !important;
}

form[action*="UpdateStatus"] select:focus {
    border-color: var(--cp-brand) !important;
    box-shadow: 
        0 0 0 3px rgba(0, 217, 255, 0.25),
        0 0 20px var(--cp-brand-glow) !important;
}

/* -------------------------------------------
   GLOW ANIMATION FOR ACTIVE SELECTS
------------------------------------------- */

@keyframes selectGlow {
    0%, 100% {
        box-shadow: 
            0 0 0 3px rgba(0, 217, 255, 0.25),
            0 0 28px var(--cp-brand-glow),
            0 12px 36px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 0 3px rgba(0, 217, 255, 0.3),
            0 0 36px var(--cp-brand-glow),
            0 14px 40px rgba(0, 0, 0, 0.55);
    }
}

select.form-select:focus,
select.form-select-sm:focus,
select.cp-select:focus {
    animation: selectGlow 2s ease-in-out infinite;
}

/* -------------------------------------------
   IMPORTANT NOTES ON DATETIME CALENDAR POPUP
------------------------------------------- */

/*
The datetime picker calendar popup is MOSTLY controlled by the browser 
and has very limited CSS support:

✅ What CAN be styled (Chrome/Edge):
- The calendar icon/button
- Individual date/time field segments
- Field focus states
- Basic colors

❌ What CANNOT be styled:
- The actual popup calendar UI (Chrome native)
- Month/year navigation buttons in popup
- Calendar grid layout in popup
- Today button, time picker UI
- Firefox popup (completely browser-controlled)
- Safari popup (completely browser-controlled)

The CSS above styles what's possible. For a fully custom calendar,
you'd need a JavaScript library like:
- Flatpickr
- React DatePicker
- Vanilla Calendar
- Air Datepicker

But the native datetime picker with our styling looks pretty good!
*/
