/**
 * CITY AUTOCOMPLETE STYLES
 * Production-ready - Mobile-first
 */

/* Container autocomplete */
.city-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 8px;
    display: none;
    -webkit-overflow-scrolling: touch;
}

/* Items résultats */
.city-result-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.city-result-item:hover,
.city-result-item.active {
    background: #fff5ed;
    border-left: 3px solid #ff9544;
}

.city-result-item:last-of-type {
    border-bottom: none;
}

.city-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.city-name strong {
    color: #ff9544;
}

.city-details {
    font-size: 13px;
    color: #666;
}

/* Bouton ajouter ville */
.city-add-button {
    padding: 16px 18px;
    background: linear-gradient(135deg, #fff5ed, #ffe8d6);
    border-top: 2px solid #ff9544;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    color: #c2410c;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.city-add-button:hover {
    background: linear-gradient(135deg, #ffe8d6, #ffd4a8);
}

.city-add-button span {
    font-size: 18px;
}

/* Messages */
.city-no-results,
.city-error {
    padding: 20px;
    text-align: center;
}

.city-no-results-text {
    color: #666;
    margin-bottom: 12px;
}

.city-error {
    color: #dc2626;
}

/* Input validation states */
.form-input.valid {
    border: 2px solid #10b981 !important;
    background: #f0fdf4 !important;
}

.form-input.invalid {
    border: 2px solid #dc2626 !important;
    background: #fef2f2 !important;
}

/* MODAL */
.city-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.city-modal {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-modal-header {
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.city-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.city-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-modal-close:hover {
    background: #fee;
    color: #dc2626;
}

.city-modal-body {
    padding: 24px;
}

.city-modal-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 12px 16px;
    color: #075985;
    font-size: 14px;
    margin-bottom: 20px;
}

.city-form-group {
    margin-bottom: 20px;
}

.city-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.city-form-group small {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.city-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

.city-input:focus {
    outline: none;
    border-color: #ff9544;
    box-shadow: 0 0 0 3px rgba(255, 149, 68, 0.1);
}

.city-input:invalid {
    border-color: #dc2626;
}

.city-modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 16px;
}

.city-modal-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 16px;
}

.city-modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.city-btn {
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.city-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.city-btn-cancel:hover {
    background: #e0e0e0;
}

.city-btn-submit {
    background: #ff9544;
    color: white;
}

.city-btn-submit:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 149, 68, 0.3);
}

.city-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .city-modal {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }
    
    .city-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .city-autocomplete-results {
        max-height: 300px;
    }
    
    .city-modal-footer {
        flex-direction: column;
    }
    
    .city-btn {
        width: 100%;
    }
}

/* Scrollbar custom */
.city-autocomplete-results::-webkit-scrollbar,
.city-modal::-webkit-scrollbar {
    width: 8px;
}

.city-autocomplete-results::-webkit-scrollbar-track,
.city-modal::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.city-autocomplete-results::-webkit-scrollbar-thumb,
.city-modal::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.city-autocomplete-results::-webkit-scrollbar-thumb:hover,
.city-modal::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Position relative pour le parent */
.form-row.single {
    position: relative;
}
