/* Unified Dropdown Styling - Matches Navbar Design */

:root {
    --primary-color: #FEA116;
    --dark-color: #0F172B;
    --light-color: #F1F8FF;
    --text-color: #1a1a1a;
    --border-color: #d8dce0;
    --hover-bg: rgba(254, 161, 22, 0.1);
}

/* ============================================
   FORM SELECT - Unified Styling
   ============================================ */

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8125rem 2.5rem 0.8125rem 1rem;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    line-height: 1.5;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23FEA116' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    cursor: pointer;
}

.form-select:hover {
    border-color: #ccc;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.form-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(254, 161, 22, 0.12),
        0 4px 12px rgba(254, 161, 22, 0.15);
}

.form-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.65;
}

.form-select[multiple] {
    background-image: none;
    padding: 0.8125rem 1rem;
}

/* ============================================
   DROPDOWN MENU - Navbar Style
   ============================================ */

.dropdown-menu {
    background-color: rgba(15, 23, 43, 0.95);
    border: 1px solid rgba(254, 161, 22, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    animation: slideDown 0.3s ease-in-out;
    margin-top: 8px;
}

.dropdown-menu.show {
    animation: slideDown 0.3s ease-in-out;
}

.dropdown-item {
    color: var(--light-color);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 18px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(254, 161, 22, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 22px;
    text-decoration: none;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: rgba(254, 161, 22, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dropdown-item:disabled {
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    background-color: transparent;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.dropdown-header {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 18px;
    letter-spacing: 0.5px;
}

/* ============================================
   DROPDOWN TOGGLE - Icon Animation
   ============================================ */

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid currentColor;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s ease;
    color: var(--light-color);
}

.dropdown-toggle:hover::after {
    color: var(--primary-color);
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* ============================================
   NESTED SUBMENU - Navbar Style
   ============================================ */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 0.125rem;
    background-color: rgba(15, 23, 43, 0.98);
    border: 1px solid rgba(254, 161, 22, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    animation: slideDown 0.3s ease-in-out;
    min-width: 200px;
}

.dropdown-submenu > a.dropdown-item {
    color: var(--light-color);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 18px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-submenu > a.dropdown-item:hover,
.dropdown-submenu > a.dropdown-item:focus {
    background-color: rgba(254, 161, 22, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 22px;
}

.dropdown-submenu > a.dropdown-item[aria-expanded="true"] {
    background-color: rgba(254, 161, 22, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dropdown-submenu .dropdown-item {
    color: var(--light-color);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 18px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-submenu .dropdown-item:hover,
.dropdown-submenu .dropdown-item:focus {
    background-color: rgba(254, 161, 22, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 22px;
}

.dropdown-submenu .dropdown-item.active {
    background-color: rgba(254, 161, 22, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dropdown-submenu > a::after {
    float: right;
    border: solid rgba(255, 255, 255, 0.5);
    border-width: 0 1.5px 1.5px 0;
    display: inline-block;
    padding: 3px;
    margin-left: 10px;
    transform: rotate(-45deg) translateY(-2px);
    transition: transform 0.3s ease;
}

.dropdown-submenu > a[aria-expanded="true"]::after {
    transform: rotate(45deg) translateY(-2px);
}

/* ============================================
   CUSTOM DROPDOWNS - Select Alternatives
   ============================================ */

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: block;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23FEA116' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.custom-select:hover {
    border-color: #ccc;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.custom-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(254, 161, 22, 0.12),
        0 4px 12px rgba(254, 161, 22, 0.15);
}

/* ============================================
   SELECT WITH ICON - Enhanced Style
   ============================================ */

.select-with-icon {
    position: relative;
    display: inline-block;
    width: 100%;
}

.select-with-icon::before {
    content: attr(data-icon);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.select-with-icon select {
    padding-left: 40px;
}

/* ============================================
   BUTTON DROPDOWN - Navbar Style
   ============================================ */

.btn-group .dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.btn-group .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.btn-group.show .dropdown-toggle {
    box-shadow: 0 0 0 0.2rem rgba(254, 161, 22, 0.25);
}

/* ============================================
   FORM LABEL - Enhanced with Dropdowns
   ============================================ */

.form-label {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.625rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    display: block;
    transition: all 0.3s ease;
    user-select: none;
}

.form-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

.form-select:focus ~ .form-label,
.custom-select:focus ~ .form-label {
    color: var(--primary-color);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 991.98px) {
    .dropdown-submenu .dropdown-menu {
        position: static;
        left: auto;
        top: auto;
        margin-left: 1.5rem;
        margin-top: 5px;
        box-shadow: none;
        border: none;
        background-color: transparent;
    }

    .dropdown-submenu > a::after {
        float: none;
        transform: rotate(-45deg);
        display: inline-block;
        margin-left: 5px;
    }

    .dropdown-submenu > a[aria-expanded="true"]::after {
        transform: rotate(45deg);
    }
}

/* Enhanced Responsive Adjustments */

@media (max-width: 480px) {
    .form-select,
    .custom-select {
        font-size: 16px;
        padding: 0.75rem 2.25rem 0.75rem 0.75rem;
        border-radius: 6px;
        width: 100%;
    }

    .dropdown-item {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .dropdown-item:hover {
        padding-left: 15px;
    }

    .dropdown-menu {
        min-width: 140px;
        max-width: 90vw;
        border-radius: 6px;
    }

    .dropdown-submenu .dropdown-menu {
        margin-left: 1rem !important;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .select-with-icon select {
        padding-left: 36px;
    }

    .dropdown-header {
        font-size: 11px;
        padding: 8px 12px;
    }
}

@media (max-width: 576px) {
    .form-select,
    .custom-select {
        font-size: 15px;
        padding: 0.75rem 2.25rem 0.75rem 0.75rem;
    }

    .dropdown-item {
        padding: 10px 15px;
        font-size: 13px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .dropdown-item:hover {
        padding-left: 18px;
    }

    .dropdown-menu {
        min-width: 160px;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 640px) and (min-width: 481px) {
    .form-select,
    .custom-select {
        font-size: 14px;
    }

    .dropdown-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 180px;
    }
}

@media (max-width: 768px) and (min-width: 641px) {
    .form-select,
    .custom-select {
        font-size: 15px;
    }

    .dropdown-item {
        padding: 12px 18px;
        font-size: 14px;
    }

    .dropdown-menu {
        min-width: 200px;
    }
}

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

.dark-mode .form-select,
.dark-mode .custom-select {
    background-color: #1a1a1a;
    color: var(--light-color);
    border-color: rgba(254, 161, 22, 0.2);
}

.dark-mode .form-select:focus,
.dark-mode .custom-select:focus {
    background-color: #2a2a2a;
}

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

.form-select:focus-visible,
.custom-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .form-select,
    .custom-select,
    .dropdown-menu,
    .dropdown-item,
    .dropdown-toggle::after {
        transition: none;
        animation: none;
    }
}
