/**
 * Phone Input Styles
 * @package DeveloperStarter
 */

.phone-input-wrapper {
    position: relative;
}

.phone-input-wrapper input {
    padding-left: 90px !important;
}

[dir="rtl"] .phone-input-wrapper input {
    padding-left: var(--spacing-md) !important;
    padding-right: 90px !important;
}

.country-selector {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    border-right: 1px solid #e5e7eb;
    z-index: 10;
}

[dir="rtl"] .country-selector {
    left: auto;
    right: 2px;
    border-right: none;
    border-left: 1px solid #e5e7eb;
    border-radius: 0 8px 8px 0;
}

.country-flag {
    font-size: 1.2rem;
}

.country-code {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
}

[dir="rtl"] .country-dropdown {
    left: auto;
    right: 0;
}

.country-dropdown.active {
    display: block;
}

.country-search {
    position: sticky;
    top: 0;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.country-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
}

.country-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.country-item:hover {
    background: #f3f4f6;
}

.country-item .flag {
    font-size: 1.3rem;
}

.country-item .name {
    flex: 1;
    font-size: 0.9rem;
}

.country-item .dial-code {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Validation States */
.phone-input-wrapper.valid input {
    border-color: #22c55e;
}

.phone-input-wrapper.invalid input {
    border-color: #ef4444;
}

.phone-validation-message {
    font-size: 0.8rem;
    margin-top: 4px;
}

.phone-validation-message.error {
    color: #ef4444;
}

.phone-validation-message.success {
    color: #22c55e;
}
