/**
 * Service Hub - Country Selector Styles
 * Version: 1.0.0
 */

/* Container */
.service-hub-selector {
    position: relative;
    width: 100%;
    max-width: 100%;
    /*margin-bottom: 1rem;*/
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: opacity 0.3s ease;
}

.service-hub-selector.hidden {
    display: none !important;
}

/* Button */
.service-hub-selector-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-align: left;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.service-hub-selector-button:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.service-hub-selector-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.service-hub-selector-button[aria-expanded="true"] {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button content */
.service-hub-selector-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.service-hub-selector-icon svg {
    width: 28px;
    height: 28px;
}

.service-hub-selector-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 400;
    color: #111827;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.service-hub-selector-title .service-hub-flag {
    margin: 0 0.5rem;
}

.service-hub-selector-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    color: #6b7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

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

.service-hub-selector-arrow svg {
    width: 20px;
    height: 20px;
}

/* Dropdown */
.service-hub-selector-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    animation: slideDown 0.2s ease;
    display: none; /* Hidden by default */
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Option */
.service-hub-selector-option {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.service-hub-selector-option:last-child {
    border-bottom: none;
}

.service-hub-selector-option:hover {
    background-color: #f9fafb;
}

.service-hub-selector-option:active {
    background-color: #f3f4f6;
}

/* Flag */
.service-hub-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 0.875rem;
    font-size: 1.5rem;
    flex-shrink: 0;
    /* background: #f3f4f6; */
    border-radius: 4px;
    overflow: hidden;
}

/* Country name */
.service-hub-country-name {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 400;
}

/* Scrollbar styling for dropdown */
.service-hub-selector-dropdown::-webkit-scrollbar {
    width: 8px;
}

.service-hub-selector-dropdown::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 0 0.5rem 0.5rem 0;
}

.service-hub-selector-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.service-hub-selector-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.wd-50 {
    width: 50%;
}

.fw-bold {
    font-weight: 600 !important;
}

.text-blue {
    color: #2563eb !important;
}

/* Responsive mobile styles */
@media (max-width: 640px) {
    .service-hub-selector-button {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    .service-hub-selector-title {
        font-size: 0.9375rem;
    }

    .service-hub-selector-option {
        padding: 0.75rem 1rem;
    }

    .service-hub-flag {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }

    .service-hub-country-name {
        font-size: 0.875rem;
    }

    .wd-mb-100 {
        width: 100%;
    }

}

/* Responsive tablet styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .wd-tb-75 {
        width: 75% !important;
    }
}

/* Responsive desktop styles */
@media (min-width: 1025px) {}

/* State: Selected option */
.service-hub-selector-option.selected {
    background-color: #eff6ff;
    color: #1e40af;
}

.service-hub-selector-option.selected .service-hub-country-name {
    color: #1e40af;
    font-weight: 500;
}

/* Loading state */
.service-hub-selector.loading .service-hub-selector-button {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled state */
.service-hub-selector-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.service-hub-selector-button:disabled:hover {
    border-color: #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}