/* ===========================
   Nationality Dropdown with Flags
   Shared component across forms
   =========================== */

.nationality-wrapper {
    position: relative;
    width: 100%;
}

/* Trigger button */
.nationality-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 0 44px 0 16px;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' stroke='%2345DDE6' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 10px;
}

[dir="rtl"] .nationality-trigger {
    padding: 0 16px 0 44px;
    background-position: left 16px center;
}

.nationality-trigger .fi {
    width: 22px;
    border-radius: 2px;
    flex-shrink: 0;
}

.nationality-selected-name {
    flex: 1;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nationality-placeholder {
    flex: 1;
    text-align: start;
    opacity: 0.5;
}


/* Dropdown */
.nationality-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    background: #0d1035;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    z-index: 10;
    display: none;
    overflow: hidden;
}

.nationality-wrapper.open .nationality-dropdown {
    display: block;
}

/* Search */
.nationality-search {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #fff;
    outline: none;
}

.nationality-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* List */
.nationality-list {
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.nationality-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.nationality-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nationality-list li .fi {
    width: 22px;
    border-radius: 2px;
    flex-shrink: 0;
}

.nationality-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 12px;
    padding: 0 !important;
    pointer-events: none;
}

.nationality-list::-webkit-scrollbar {
    width: 4px;
}

.nationality-list::-webkit-scrollbar-track {
    background: transparent;
}

.nationality-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* RTL: reverse dropdown content */
[lang="ar"] .nationality-dropdown {
    direction: rtl;
}
