/* ========================================
   Account Switcher Component
   ======================================== */

.account-switcher {
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.account-selector {
    position: relative;
}

.account-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-primary);
}

.account-button:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.account-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.account-icon {
    font-size: 16px;
}

.account-name {
    font-weight: 500;
}

.account-arrow {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

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

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

/* Dark mode support */
.dark-mode .account-dropdown {
    background: #1a1a1a;
}

.account-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-option:hover {
    background: var(--bg-hover);
}

.account-option.active {
    background: var(--primary-color);
    color: white;
}

.account-option.active:hover {
    background: var(--primary-dark);
}

.account-label {
    font-size: 14px;
    font-weight: 500;
}

/* Group header in dropdown */
.account-group-header {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color, #eee);
    margin-top: 4px;
    user-select: none;
}

.account-group-header:first-child,
.account-option[data-account="all"] + .account-group-header {
    border-top: none;
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .account-switcher {
        margin: 0 10px;
    }

    .account-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .account-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .account-dropdown {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .account-icon,
    .account-arrow {
        display: none;
    }

    .account-button {
        padding: 6px 10px;
    }

    .account-name {
        max-width: 80px;
    }
}
