/* ==========================================
   Branch Indicator & Switcher Styles
   Modern, professional design for multi-tenant branch switching
   ========================================== */

.branch-indicator-container {
    position: relative;
    display: inline-block;
}

.branch-indicator-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
}

.branch-indicator-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.branch-indicator-btn.active {
    background: #f1f5f9;
    border-color: #0e947a;
}

.branch-indicator-btn i:first-child {
    color: #0e947a;
    font-size: 1rem;
}

.branch-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-icon {
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.branch-indicator-btn.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Styles */
.branch-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    max-width: 280px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    animation: dropdownFadeIn 0.2s ease;
    overflow: hidden;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.branch-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0e947a 0%, #0c7a63 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.branch-dropdown-header i {
    font-size: 1.1rem;
}

.branch-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

/* Scrollbar styling */
.branch-list::-webkit-scrollbar {
    width: 6px;
}

.branch-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.branch-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.branch-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.branch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #334155;
}

.branch-item:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0e947a;
}

.branch-item.active {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #0e947a;
    font-weight: 600;
    cursor: default;
}

.branch-item i {
    font-size: 0.9rem;
    color: #cbd5e1;
    transition: color 0.15s ease;
}

.branch-item:hover:not(:disabled) i {
    color: #0e947a;
}

.branch-item.active i {
    color: #0e947a;
}

.branch-item:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.branch-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Backdrop */
.branch-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .branch-name {
        max-width: 100px;
    }

    .branch-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .branch-indicator-btn {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .branch-indicator-btn:hover {
        background: #334155;
        border-color: #475569;
    }

    .branch-dropdown {
        background: #1e293b;
        border-color: #334155;
    }

    .branch-item {
        color: #e2e8f0;
    }

    .branch-item:hover:not(:disabled) {
        background: #334155;
    }
}