/* ===================================
   PHONE INPUT WITH COUNTRY CODE
   Styles pour le sélecteur pays + téléphone
   =================================== */

/* Phone Input Wrapper */
.phone-input-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
}

.phone-input-wrapper .country-code-select {
    flex: 0 0 180px;
    min-width: 180px;
}

.phone-input-wrapper .phone-number-input {
    flex: 1;
    min-width: 0;
}

/* Country Code Select */
.country-code-select,
.country-select {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.country-code-select:hover,
.country-select:hover {
    border-color: rgba(255, 159, 64, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.country-code-select:focus,
.country-select:focus {
    outline: none;
    border-color: var(--color-primary, #FF9F40);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 159, 64, 0.1);
}

/* Options styling */
.country-code-select option,
.country-select option {
    background: #1A1A1A;
    color: #fff;
    padding: 12px 16px;
}

.country-code-select option:hover,
.country-select option:hover {
    background: rgba(255, 159, 64, 0.1);
}

/* Phone Number Input */
.phone-number-input {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.phone-number-input::placeholder {
    color: #999;
}

.phone-number-input:hover {
    border-color: rgba(255, 159, 64, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.phone-number-input:focus {
    outline: none;
    border-color: var(--color-primary, #FF9F40);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 159, 64, 0.1);
}

/* Validation States */
.phone-input-wrapper.success .country-code-select,
.phone-input-wrapper.success .phone-number-input {
    border-color: #10B981;
}

.phone-input-wrapper.error .country-code-select,
.phone-input-wrapper.error .phone-number-input {
    border-color: #EF4444;
}

/* Dark Mode Adjustments */
body.light-mode .country-code-select,
body.light-mode .country-select,
body.light-mode .phone-number-input {
    background: #fff;
    color: #000;
    border-color: #ddd;
}

body.light-mode .country-code-select option,
body.light-mode .country-select option {
    background: #fff;
    color: #000;
}

body.light-mode .phone-number-input::placeholder {
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .phone-input-wrapper {
        flex-direction: column;
    }
    
    .phone-input-wrapper .country-code-select {
        flex: 1;
        width: 100%;
        min-width: 100%;
    }
    
    .phone-input-wrapper .phone-number-input {
        width: 100%;
    }
}

/* Enhanced Select with Search (Optionnel - pour future amélioration) */
.country-select-enhanced {
    position: relative;
}

.country-search-input {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 14px;
}

.country-search-input::placeholder {
    color: #666;
}

.country-options-list {
    max-height: 300px;
    overflow-y: auto;
    background: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 10px 10px;
}

.country-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.country-option:hover {
    background: rgba(255, 159, 64, 0.1);
}

.country-option .flag {
    font-size: 20px;
}

.country-option .name {
    flex: 1;
    color: #fff;
    font-size: 14px;
}

.country-option .dial {
    color: #999;
    font-size: 13px;
}

/* Custom Scrollbar for Options */
.country-options-list::-webkit-scrollbar {
    width: 8px;
}

.country-options-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.country-options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 64, 0.3);
    border-radius: 4px;
}

.country-options-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 64, 0.5);
}

/* Loading State */
.phone-input-wrapper.loading::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 159, 64, 0.2);
    border-top-color: var(--color-primary, #FF9F40);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Helper Text */
.phone-input-helper {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.phone-input-helper i {
    font-size: 11px;
}

/* Example Display */
.phone-example {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 159, 64, 0.05);
    border: 1px solid rgba(255, 159, 64, 0.1);
    border-radius: 6px;
    font-size: 13px;
    color: #ccc;
}

.phone-example strong {
    color: var(--color-primary, #FF9F40);
}
