/* User Dropdown & Device Management Styles */

/* User Dropdown Styles */
.user-dropdown-toggle {
    position: relative;
    cursor: pointer;
}

.user-dropdown-menu {
    background: var(--glass-bg, rgba(10, 23, 27, 0.8));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-xl, 0 12px 24px rgba(0, 0, 0, 0.3));
    overflow: hidden;
    width: 250px;
    z-index: 2000;
}

body.light-mode .user-dropdown-menu {
    background: var(--glass-light-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-light-border, rgba(0, 0, 0, 0.1));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

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

body.light-mode .dropdown-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.user-greeting {
    font-size: 1.1rem;
    color: var(--text-light, #ffffff);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-gray, #aaaaaa);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu-items {
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-light, #ffffff);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

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

body.light-mode .dropdown-item {
    color: #333;
}

body.light-mode .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-item i {
    margin-right: 0.75rem;
    color: var(--primary-color, #68BE7C);
    width: 20px;
    text-align: center;
}

/* Devices Modal Styles */
.device-item, .ip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.device-item:last-child, .ip-item:last-child {
    border-bottom: none;
}

.device-item:hover, .ip-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.light-mode .device-item, body.light-mode .ip-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .device-item:hover, body.light-mode .ip-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.device-info, .ip-info {
    flex: 1;
}

.device-name, .ip-address {
    color: var(--text-light, #ffffff);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.device-details, .ip-details {
    color: var(--text-gray, #aaaaaa);
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.device-logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm, 8px);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.device-logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

body.light-mode .device-logout-btn {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .device-logout-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.current-device-badge {
    background-color: var(--primary-color, #68BE7C);
    color: var(--surface-dark, #0A171B);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.7rem;
    font-weight: 500;
}

.ip-status {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.7rem;
}

.ip-status.verified {
    background-color: rgba(104, 190, 124, 0.2);
    color: var(--primary-color, #68BE7C);
}

.ip-status.unverified {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.no-data {
    padding: 1rem;
    color: var(--text-gray, #aaaaaa);
    text-align: center;
    font-style: italic;
}

.success-message {
    background-color: rgba(104, 190, 124, 0.1);
    color: var(--primary-color, #68BE7C);
    padding: 1rem;
    text-align: center;
    border-radius: var(--radius-sm, 8px);
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 1rem;
    text-align: center;
    border-radius: var(--radius-sm, 8px);
}

/* Responsive styles */
@media (max-width: 576px) {
    .user-dropdown-menu {
        width: calc(100% - 2rem);
        right: 1rem !important;
        left: 1rem !important;
    }
    
    .dropdown-header {
        padding: 0.75rem;
    }
    
    .dropdown-item {
        padding: 0.6rem 0.75rem;
    }
    
    .device-item, .ip-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .device-logout-btn {
        margin-top: 0.5rem;
        align-self: flex-end;
    }
    
    .current-device-badge {
        margin-top: 0.5rem;
        align-self: flex-end;
    }
}

.header-nav-text-button {
    background: rgba(104, 190, 124, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(104, 190, 124, 0.3);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 0.03em;
}

body.light-mode .header-nav-text-button {
    background: rgba(104, 190, 124, 0.1);
    color: #006151;
    border: 1px solid rgba(0, 97, 81, 0.3);
}

.header-nav-text-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.header-nav-text-button:hover {
    background-color: var(--primary-color);
    color: var(--surface-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(104, 190, 124, 0.3);
}

body.light-mode .header-nav-text-button:hover {
    background-color: #006151;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 97, 81, 0.3);
}

.header-nav-text-button:hover::before {
    left: 100%;
}

#header.scrolled .header-nav-text-button {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}


.devices-button {
    background: rgba(104, 124, 190, 0.15) !important; /* Using secondary color from style.css */
    color: var(--secondary-color) !important;
    border: 1px solid rgba(104, 124, 190, 0.3) !important;
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.devices-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.devices-button:hover {
    background-color: var(--secondary-color) !important;
    color: var(--surface-dark) !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(104, 124, 190, 0.4) !important;
}

.devices-button:hover::before {
    left: 100%;
}

#header.scrolled .devices-button {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Enhanced dropdown menu styles to fix z-index and positioning */
.user-dropdown-menu {
    position: fixed !important;
    background: var(--glass-bg, rgba(10, 23, 27, 0.8));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-xl, 0 12px 24px rgba(0, 0, 0, 0.3));
    overflow: hidden;
    width: 250px;
    z-index: 9999 !important; /* Very high z-index to ensure it's above everything */
    margin-top: 15px; /* Add a significant gap between header and dropdown */
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.light-mode .user-dropdown-menu {
    background: var(--glass-light-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-light-border, rgba(0, 0, 0, 0.1));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(104, 124, 190, 0.05); /* Very subtle purple tint */
}

body.light-mode .dropdown-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(104, 124, 190, 0.05);
}

.user-greeting {
    font-size: 1.1rem;
    color: var(--text-light, #ffffff);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-gray, #aaaaaa);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu-items {
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-light, #ffffff);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

/* Dropdown menu item hover effect */
.dropdown-item:hover {
    background-color: rgba(104, 124, 190, 0.15); /* Matching purple secondary color theme */
}

.dropdown-item i {
    margin-right: 0.75rem;
    color: var(--secondary-color, #687CBE);
    width: 20px;
    text-align: center;
}

body.light-mode .dropdown-item {
    color: #333;
}

body.light-mode .dropdown-item:hover {
    background-color: rgba(104, 124, 190, 0.1);
}

/* User dropdown toggle button */
.user-dropdown-toggle {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .user-dropdown-menu {
        width: calc(100% - 20px);
        right: 10px !important;
        left: auto !important;
    }
}

.user-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-img-button {
    padding: 4px !important;
    overflow: hidden;
}

.user-dropdown-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-info {
    flex: 1;
}