/* AuthAPI Login State Management */
.show-when-logged-in,
.show-when-logged-out {
    display: none !important;
}

.show-when-logged-in.d-block {
    display: block !important;
}

.show-when-logged-out.d-block {
    display: block !important;
}

.show-when-logged-in.d-flex {
    display: flex !important;
}

.show-when-logged-out.d-flex {
    display: flex !important;
}

.show-when-logged-in.d-inline-block {
    display: inline-block !important;
}

.show-when-logged-out.d-inline-block {
    display: inline-block !important;
}

/* Bootstrap responsive utility overrides with higher specificity */
.d-none {
    display: none !important;
}

/* Large screen and up - hide when d-lg-none */
@media (min-width: 992px) {
    .show-when-logged-out.d-lg-none,
    .show-when-logged-in.d-lg-none,
    .d-lg-none {
        display: none !important;
    }
    
    .show-when-logged-out.d-lg-block {
        display: block !important;
    }
    
    .show-when-logged-in.d-lg-block {
        display: block !important;
    }
    
    .show-when-logged-out.d-lg-flex {
        display: flex !important;
    }
    
    .show-when-logged-in.d-lg-flex {
        display: flex !important;
    }
    
    .show-when-logged-out.d-lg-inline-block {
        display: inline-block !important;
    }
    
    .show-when-logged-in.d-lg-inline-block {
        display: inline-block !important;
    }
}

/* Medium screens - show when d-md-block */
@media (min-width: 768px) and (max-width: 991.98px) {
    .show-when-logged-out.d-md-block {
        display: block !important;
    }
    
    .show-when-logged-in.d-md-block {
        display: block !important;
    }
    
    .show-when-logged-out.d-md-none {
        display: none !important;
    }
    
    .show-when-logged-in.d-md-none {
        display: none !important;
    }
}

/* Small screens - show when d-sm-block */
@media (max-width: 767.98px) {
    .show-when-logged-out.d-sm-block {
        display: block !important;
    }
    
    .show-when-logged-in.d-sm-block {
        display: block !important;
    }
    
    .show-when-logged-out.d-sm-none {
        display: none !important;
    }
    
    .show-when-logged-in.d-sm-none {
        display: none !important;
    }
}

/* Profile Dropdown Styles */
.profile-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 20px;
}

.profile-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: #78EB54;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.profile-avatar span {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.profile-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
}

.profile-toggle i {
    color: #ffffff;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.profile-dropdown:hover .profile-toggle i {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-dropdown:hover .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.profile-menu li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-menu li:last-child {
    border-bottom: none;
}

.profile-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.profile-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #007bff;
}

.profile-menu a i {
    margin-right: 12px;
    width: 16px;
    font-size: 14px;
    color: #666666;
}

.profile-menu a:hover i {
    color: #007bff;
}

.new-badge {
    background: #28a745;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 600;
    text-transform: uppercase;
}

/* Dark mode toggle */
.profile-toggle .fas.fa-moon,
.profile-toggle .fas.fa-sun {
    font-size: 14px;
    margin-left: 8px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-dropdown {
        margin-right: 10px;
    }
    
    .profile-name {
        display: none;
    }
    
    .profile-menu {
        width: 200px;
        right: -20px;
    }
}

@media (max-width: 480px) {
    .profile-menu {
        width: 180px;
        right: -40px;
    }
}

/* Animation for profile avatar */
.profile-avatar {
    transition: all 0.3s ease;
}

.profile-toggle:hover .profile-avatar {
    transform: scale(1.1);
}

/* Hover effect for the entire dropdown */
.profile-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 10px;
    background: transparent;
    z-index: 999;
}

@media (min-width: 992px) {
   .show-when-logged-out .d-block .d-lg-none {
        display: none !important;
    }
}