/**
 * Dropdown component styles
 * Handles navigation dropdowns and user menu dropdowns
 */

/* Proper dropdown toggle behavior */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(31,38,135,0.2);
    min-width: 240px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 0.5rem;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    overflow: visible;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #000000 !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    font-size: 0.9rem;
    z-index: 10;
    gap: 0.75rem;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: height 0.3s ease;
}

.dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea !important;
}

/* Fallback for dropdown text visibility */
.dropdown-menu li a,
.dropdown-menu li a span,
.dropdown-menu li a:link,
.dropdown-menu li a:visited,
.dropdown-menu li a:hover,
.dropdown-menu li a:active {
    color: #000000 !important;
    text-decoration: none !important;
}

.dropdown-menu li a:hover {
    color: #667eea !important;
}

.dropdown-menu a:hover::before {
    height: 70%;
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    background: rgba(0,0,0,0.1);
    border: none;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius) !important;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    font-weight: 600;
    font-size: 0.9rem !important;
    white-space: nowrap;
}

.dropdown-toggle:hover {
    background: rgba(255,255,255,0.25) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Mobile Responsive Styles for Dropdown */
@media (max-width: 768px) {
    .dropdown {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .dropdown-menu {
        position: static;
        top: auto;
        right: auto;
        background: var(--primary-gradient);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(31,38,135,0.3);
        backdrop-filter: blur(10px);
        min-width: 100%;
        z-index: 9999;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        margin-top: 0.5rem;
        list-style: none;
        padding: 0.5rem 0;
        margin: 0;
        display: none;
        overflow: visible;
    }

    .dropdown-menu.show {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-menu a {
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        color: #ffffff !important;
        text-decoration: none !important;
        transition: all 0.3s ease;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
        font-weight: 600;
        position: relative;
        font-size: 0.95rem;
        z-index: 10;
        gap: 0.75rem;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }

    .dropdown-menu a:hover {
        background: rgba(255,255,255,0.2);
        color: #ffffff !important;
    }

    /* Mobile dropdown text overrides */
    .dropdown-menu li a,
    .dropdown-menu li a span,
    .dropdown-menu li a:link,
    .dropdown-menu li a:visited,
    .dropdown-menu li a:hover,
    .dropdown-menu li a:active {
        color: #ffffff !important;
        text-decoration: none !important;
    }

    .dropdown-menu li a:hover {
        color: #ffffff !important;
    }

    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        background: rgba(255,255,255,0.15) !important;
        border: 1px solid rgba(255,255,255,0.3) !important;
        border-radius: var(--border-radius) !important;
    }

    .dropdown-toggle:hover {
        background: rgba(255,255,255,0.25) !important;
        transform: none;
        box-shadow: none;
    }

    .dropdown-arrow {
        transition: transform 0.3s ease;
    }

    .dropdown-toggle.active .dropdown-arrow {
        transform: rotate(180deg);
    }
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
    display: inline-block;
}

.dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* Responsive dropdown adjustments */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        margin-top: 0;
    }

    .dropdown-menu a {
        color: white;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

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