/* Dropdown Component Styles */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Toggle Button */
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-toggle:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.dropdown-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-chevron {
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

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

/* Menu Container */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 200px;
    margin-top: 0.25rem;
    padding: 0;
    background:
        /* Subtle metallic sheen overlay */
        linear-gradient(
            110deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 50%,
            transparent 60%,
            transparent 100%
        ),
        /* Vertical highlight for polish effect */
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.02) 0%,
            transparent 15%,
            transparent 85%,
            rgba(0, 0, 0, 0.02) 100%
        ),
        /* Base dark purple gradient */
        linear-gradient(
            to bottom,
            rgba(45, 38, 62, 0.9),
            rgba(35, 30, 48, 0.9)
        ); /* Dark purple gradient with subtle metallic sheen */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Position Variants */
.dropdown-left .dropdown-menu {
    right: auto;
    left: 0;
}

.dropdown-center .dropdown-menu {
    right: 50%;
    transform: translateX(50%);
}

/* Menu Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dropdown-item:active:not(.disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Item Icons */
.dropdown-item-icon,
.dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    opacity: 0.8;
}

.dropdown-item:hover:not(.disabled) .dropdown-item-icon,
.dropdown-item:hover:not(.disabled) .dropdown-icon {
    opacity: 1;
}

/* Special Item Styles */
.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover:not(.disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.dropdown-item.text-success {
    color: #10b981;
}

.dropdown-item.text-success:hover:not(.disabled) {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.dropdown-item.text-warning {
    color: #f59e0b;
}

.dropdown-item.text-warning:hover:not(.disabled) {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

/* Divider */
.dropdown-divider {
    height: 1px;
    margin: 0.25rem 0;
    background: rgba(255, 255, 255, 0.1);
}

/* Header */
.dropdown-header {
    padding: 0.5rem 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Show State */
.dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

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

/* Mobile Adjustments */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    .dropdown-left .dropdown-menu,
    .dropdown-center .dropdown-menu {
        right: 1rem;
        left: 1rem;
        transform: none;
    }
}

/* Compact Variants */
.dropdown-toggle.button-small,
.dropdown-toggle.button-sm {
    padding: 0.375rem 0.5rem !important;
    min-width: auto;
    font-size: 0.8125rem;
}

.dropdown-toggle.button-icon {
    padding: 0.5rem;
}

.dropdown-toggle.button-icon .dropdown-toggle-text {
    display: none;
}

/* Dark Theme Adjustments */
.dropdown-menu {
    background: var(--surface-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation Dropdown Specific Styles */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Style to match nav-links > a exactly */
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: white;
    text-decoration: none;
    font-weight: var(--font-medium);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    opacity: 0.85;
    background: transparent;
    border: none;
    font-size: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* Match nav-link exact styling */
    line-height: 1.5;
    white-space: nowrap;
}

.nav-dropdown-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
}

.nav-dropdown-toggle:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.nav-dropdown-toggle:hover::before {
    opacity: 0.15;
}

.nav-dropdown-toggle[aria-expanded="true"] {
    opacity: 1;
}

.nav-dropdown-toggle[aria-expanded="true"]::before {
    opacity: 0.2;
}

/* Active state when on a product page */
.nav-dropdown-toggle.active {
    opacity: 1;
    font-weight: var(--font-semibold);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.2);
}

.nav-dropdown-toggle.active::before {
    opacity: 0.15;
}

.nav-dropdown-toggle .dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.7;
    width: 10px;
    height: 10px;
    margin-left: 0.25rem;
}

.nav-dropdown-toggle:hover .dropdown-arrow {
    opacity: 1;
}

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

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-width: 220px;
    padding: 0.5rem;
    background:
        /* Subtle metallic sheen overlay */
        linear-gradient(
            110deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 50%,
            transparent 60%,
            transparent 100%
        ),
        /* Vertical highlight for polish effect */
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.02) 0%,
            transparent 15%,
            transparent 85%,
            rgba(0, 0, 0, 0.02) 100%
        ),
        /* Base dark purple gradient */
        linear-gradient(
            to bottom,
            rgba(45, 38, 62, 0.95),
            rgba(35, 30, 48, 0.95)
        ); /* Dark purple gradient with subtle metallic sheen */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.03); /* Match nav bar border */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Match nav bar bottom border emphasis */
    border-radius: 12px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.1); /* Match nav bar shadow style */
}

.nav-dropdown-menu .dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.nav-dropdown-menu .dropdown-item {
    display: block;
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(2px);
}

.nav-dropdown-menu .dropdown-item-active {
    background: var(--gradient-brand);
    color: white;
    font-weight: var(--font-semibold);
    position: relative;
}

.nav-dropdown-menu .dropdown-item-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: white;
    border-radius: 0 2px 2px 0;
}

.nav-dropdown-menu .dropdown-item-active:hover {
    transform: none;
    opacity: 0.95;
}

.nav-dropdown-menu .dropdown-loading,
.nav-dropdown-menu .dropdown-empty {
    padding: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
}

.dropdown-loading,
.dropdown-empty {
    padding: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
}
