/*
Theme Name: SmartMag Child
Theme URI: https://smartmag.theme-sphere.com/
Description: A child theme of SmartMag
Author: ThemeSphere
Author URI: https://theme-sphere.com
Template: smart-mag
Version: 1.1
*/

/* Auth Dropdown Styles */
.auth-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.auth-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

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

.auth-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Hover to show dropdown on desktop */
.auth-dropdown-wrapper:hover .auth-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Rotate arrow on hover */
.auth-dropdown-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* JavaScript controlled visibility (for mobile and clicks) */
.auth-dropdown-menu[aria-hidden="false"] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.auth-dropdown-content {
    padding: 10px;
}

.auth-user-info {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.user-name {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
    color: #333;
}

.user-email {
    font-size: 12px;
    color: #666;
}

.auth-dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-dropdown-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.auth-dropdown-link:hover {
    background-color: #f5f5f5;
    color: #333;
}

.auth-dropdown-link.logout-link:hover {
    background-color: #fee;
    color: #d63384;
}

.auth-dropdown-link i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* Dark mode support */
.s-dark .auth-dropdown-menu {
    background: #2a2a2a;
    border-color: #444;
}

.s-dark .user-name {
    color: #fff;
}

.s-dark .user-email {
    color: #ccc;
}

.s-dark .auth-dropdown-link {
    color: #fff;
}

.s-dark .auth-dropdown-link:hover {
    background-color: #3a3a3a;
    color: #fff;
}

.s-dark .auth-user-info {
    border-color: #444;
}

a.xc-custom-ticket-button {
    background: #f16820;
    color: #fff;
}
a.xc-custom-ticket-button:hover {
    color: #fff;
    background: #cb6823;
}

/* Mobile Auth Component Optimization */
@media (max-width: 768px) {
    /* Hide desktop-only elements on mobile */
    .desktop-only {
        display: none !important;
    }
    
    .smart-head-mobile .desktop-only {
        display: none !important;
    }
    
    /* Optimize auth dropdown for mobile */
    .smart-head-mobile .auth-dropdown-wrapper {
        position: relative;
    }
    
    .smart-head-mobile .auth-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 200px;
        margin-top: 5px;
    }
    
    /* Make the auth icon more touch-friendly on mobile */
    .smart-head-mobile .auth-dropdown-toggle {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Larger touch targets for dropdown links */
    .smart-head-mobile .auth-dropdown-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .auth-dropdown-menu {
        right: -10px;
        min-width: 180px;
    }
    
    .smart-head-mobile .auth-dropdown-menu {
        right: 0;
    }

    /* Enable hover on mobile as well - some devices support it */
    .auth-dropdown-wrapper:hover .auth-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .auth-dropdown-wrapper:hover .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Ensure touch/click works on mobile */
    .auth-dropdown-toggle {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
}