/* Auth Dropdown Styles - CSS Only (No JavaScript) */
.auth-dropdown, .user-dropdown {
    position: relative;
}

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

.dropdown-trigger {
    position: relative;
}

.auth-dropdown .dropdown-toggle,
.user-dropdown .dropdown-toggle {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    outline: none;
}

.auth-dropdown .dropdown-toggle:hover,
.user-dropdown .dropdown-toggle:hover,
.auth-dropdown .dropdown-toggle:focus,
.user-dropdown .dropdown-toggle:focus {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.auth-dropdown .dropdown-toggle::after,
.user-dropdown .dropdown-toggle::after {
    display: none; /* Hide default Bootstrap arrow */
}

/* SVG Icons Styling */
.auth-dropdown .dropdown-toggle svg,
.user-dropdown .dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.auth-dropdown .dropdown-toggle:hover svg,
.user-dropdown .dropdown-toggle:hover svg {
    transform: scale(1.1);
}

/* Dropdown Menu - CSS Only Implementation */
.dropdown-menu {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 10px 0;
    margin-top: 10px;
    min-width: 220px;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: auto;
    z-index: 9999;
    list-style: none;
    margin: 0;
    /* Don't use display: none - use opacity and visibility instead */
}

/* Show dropdown on hover and focus - Updated for new structure */
.css-dropdown:hover .dropdown-menu,
.css-dropdown:focus-within .dropdown-menu,
.auth-dropdown:hover .dropdown-menu,
.user-dropdown:hover .dropdown-menu,
.auth-dropdown:focus-within .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Show on dropdown toggle hover/focus */
.dropdown-toggle:hover + .dropdown-menu,
.dropdown-toggle:focus + .dropdown-menu,
.dropdown-toggle:active + .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Keep dropdown visible when hovering over it */
.dropdown-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Mobile touch support */
.dropdown-toggle:active ~ .dropdown-menu,
.css-dropdown:active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.dropdown-item {
    color: #333;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: #f8f9fa;
    color: #3498db;
    padding-right: 25px;
    transform: translateX(-5px);
}

.dropdown-item.text-danger:hover {
    background: #ffe6e6;
    color: #dc3545;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.dropdown-item:hover svg {
    transform: scale(1.1);
}

.dropdown-divider {
    margin: 8px 15px;
    border-color: #eee;
    opacity: 0.5;
}

/* RTL Support */
.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Animation for dropdown arrow - CSS Only */
.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-trigger:hover .dropdown-arrow,
.dropdown-trigger:focus-within .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 200px;
        margin-top: 5px;
    }
    
    .auth-dropdown .dropdown-toggle,
    .user-dropdown .dropdown-toggle {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .dropdown-item {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Touch support for mobile */
    .dropdown-trigger:active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Accessibility improvements */
.dropdown-toggle:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.dropdown-item:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
    background: #f8f9fa;
    color: #3498db;
}

/* Ensure dropdown stays open when navigating with keyboard */
.dropdown-trigger:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Loading state */
.dropdown-toggle.loading {
    opacity: 0.7;
    pointer-events: none;
}

.dropdown-toggle.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error states */
.dropdown-item.success {
    color: #28a745;
}

.dropdown-item.error {
    color: #dc3545;
}

/* Focus states for accessibility */
.dropdown-toggle:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.dropdown-item:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}