/* Dial Codes Custom Dropdown CSS */
/* Specifically for Phone Code Selection */

.js-dial-code-container {
    position: static !important; /* Fix Stacking Context */
    width: 140px; /* Fixed width for phone codes */
    flex: 0 0 140px; /* Prevent growing/shrinking in flex groups */
    z-index: 1001; /* Ensure container is above other elements */
    overflow: visible !important;
}

.js-dial-code-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    position: relative;
    z-index: 1002; /* Trigger above container */
}

.js-dial-code-trigger:hover {
    border-color: #86b7fe;
}

.js-dial-code-trigger .selected-flag {
    width: 24px;
    height: 16px;
    margin-left: 10px;
    object-fit: cover;
}

.js-dial-code-dropdown {
    position: absolute !important;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999 !important; /* Maximum Z-Index */
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.js-dial-code-dropdown.show {
    display: block !important;
}

.dial-code-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.dial-code-option:hover {
    background-color: #f8f9fa;
}

.dial-code-option img {
    width: 24px;
    height: 16px;
    margin-left: 10px;
    object-fit: cover;
}

.dial-code-option .country-name {
    flex-grow: 1;
}

.dial-code-option .country-code {
    color: #6c757d;
    font-size: 0.9em;
}

/* FIX: Prevent dropdown clipping - Mandatory Overrides */
.js-dial-code-container,
.auth-section,
.auth-wrapper,
.login-section,
.card,
.login-card,
.auth-card {
    overflow: visible !important;
}

/* Ensure dropdown always on top when moved to body */
body > .js-dial-code-dropdown {
    z-index: 2147483647 !important; /* Max signed 32-bit integer */
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2) !important;
    opacity: 1 !important;
    visibility: visible !important;
}
