/**
 * ============================================
 * NAV DROPDOWNS - Unified bubble style
 * Single bubble with arrow, no inner box
 * ============================================
 */

/* ============================================
   DROPDOWN WRAPPER
   ============================================ */
.nav-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Toggle button - inherits .nav-link style */
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.nav-dropdown-chevron {
    font-size: 0.5rem;
    margin-left: 0.125rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

/* ============================================
   GAP BRIDGE - Prevents dropdown closing
   ============================================ */
.nav-dropdown-wrapper::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.75rem;
}

/* ============================================
   DROPDOWN PANEL - Single bubble, no inner box
   ============================================ */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 200px;
    background: var(--bg-secondary, #12121c);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(124, 58, 237, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 1003;
}

/* Decorative arrow */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--bg-secondary, #12121c);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

/* Inner container - MUST be transparent, no visual style */
.nav-dropdown-inner {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    /* Force override any other styles */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* ============================================
   HOVER OPEN (Desktop)
   ============================================ */
@media (min-width: 768px) {
    .nav-dropdown-wrapper:hover .nav-dropdown-chevron {
        transform: rotate(180deg);
        opacity: 1;
    }

    .nav-dropdown-wrapper:hover .nav-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }
}

/* ============================================
   DROPDOWN ITEMS
   ============================================ */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.8125rem;
    opacity: 0.7;
    display: inline-block !important;
}

.nav-dropdown-item:hover {
    background: rgba(124, 58, 237, 0.12);
    color: var(--text-primary, #f5f5f7);
}

.nav-dropdown-item:hover i {
    opacity: 1;
}

.nav-dropdown-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple-light, #a78bfa);
}

.nav-dropdown-item.active i {
    opacity: 1;
    color: var(--accent-purple-light, #a78bfa);
}

/* ============================================
   LANGUAGE DROPDOWN - Same bubble style
   ============================================ */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 140px;
    background: var(--bg-secondary, #12121c);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(124, 58, 237, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 1003;
}

/* Decorative arrow for language dropdown */
.lang-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    transform: rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--bg-secondary, #12121c);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

/* Language selector hover open */
@media (min-width: 768px) {
    .lang-selector::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 0.75rem;
    }
    
    .lang-selector:hover .lang-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }
    
    .lang-selector:hover .lang-chevron {
        transform: rotate(180deg);
    }
}

/* Language options - same style as dropdown items */
.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: rgba(124, 58, 237, 0.12);
    color: var(--text-primary, #f5f5f7);
}

.lang-option.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple-light, #a78bfa);
}

/* ============================================
   MOBILE: Hide dropdowns
   ============================================ */
@media (max-width: 767px) {
    .nav-dropdown-wrapper .nav-dropdown {
        display: none !important;
    }
    .nav-dropdown-chevron {
        display: none;
    }
}

/* ============================================
   MOBILE SECTION LABEL
   ============================================ */
.nav-mobile-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem 0.25rem;
    color: var(--accent-purple-light, #a78bfa);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

.nav-mobile-section-label i {
    font-size: 0.625rem;
}

/* Mobile sub-link (indented) */
.nav-mobile-sub {
    padding-left: 2.5rem !important;
    font-size: 0.8125rem;
    opacity: 0.85;
}

/* ============================================
   LORCANA THEME OVERRIDES
   ============================================ */
[data-theme="lorcana"] .nav-dropdown,
[data-theme="lorcana"] .lang-dropdown {
    background: #1E2140;
    border-color: rgba(211, 186, 132, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(211, 186, 132, 0.1);
}

[data-theme="lorcana"] .nav-dropdown::before,
[data-theme="lorcana"] .lang-dropdown::before {
    background: #1E2140;
    border-top-color: rgba(211, 186, 132, 0.2);
    border-left-color: rgba(211, 186, 132, 0.2);
}

[data-theme="lorcana"] .nav-dropdown-item,
[data-theme="lorcana"] .lang-option {
    color: var(--parchment-dark, #C9A87A);
}

[data-theme="lorcana"] .nav-dropdown-item:hover,
[data-theme="lorcana"] .lang-option:hover {
    background: rgba(211, 186, 132, 0.1);
    color: var(--parchment, #E3CAA8);
}

[data-theme="lorcana"] .nav-dropdown-item.active,
[data-theme="lorcana"] .lang-option.active {
    background: rgba(211, 186, 132, 0.15);
    color: var(--illuminary-gold, #D3BA84);
}

[data-theme="lorcana"] .nav-mobile-section-label {
    color: var(--illuminary-gold-dark, #B89D5E);
}