/**
 * Popup стили (модальные окна)
 * 
 * @package MedEquip_Aggregator
 */

/* ===== Base Popup ===== */
.popup-base {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.popup-base__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.popup-base__inner {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    background: #f7f7f7;
    border-radius: 0;
    z-index: 1;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-base__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.popup-base__close:hover {
    background: #e9ecef;
    color: #dc3545;
}

.popup-base__close svg {
    width: 20px;
    height: 20px;
}

/* ===== City Popup ===== */
.popup-city__content {
    padding: 40px 30px 30px;
}

.popup-city__title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 24px 0;
    text-align: center;
}

#current-city-name {
    color: #12356a;
}

/* City Search */
.popup-city__search {
    position: relative;
    margin-bottom: 24px;
}

.popup-city__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.city-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: none;
    border-radius: 0;
    background-color: #fff;
    font-size: 16px;
    transition: all 0.2s;
}

.city-search-input:focus {
    outline: none;
    border-color: #12356a;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* City List */
.popup-city__list {
    max-height: 400px;
    overflow-y: auto;
    margin: -8px;
    padding: 8px;
}

.popup-city__list::-webkit-scrollbar {
    width: 8px;
}

.popup-city__list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.popup-city__list::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.popup-city__list::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.popup-city__popular,
.popup-city__results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.popup-city__item {
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 0;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #222;
    transition: all 0.2s;
}

.popup-city__item:hover {
    background: #12356a;
    border-color: #12356a;
    color: #fff;
}

.popup-city__item .city-region {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.no-results {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .popup-base__inner {
        width: 95%;
        margin: 20px auto;
    }
    
    .popup-city__content {
        padding: 30px 20px 20px;
    }
    
    .popup-city__title {
        font-size: 20px;
    }
    
    .popup-city__popular,
    .popup-city__results {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .popup-city__list {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .popup-city__popular,
    .popup-city__results {
        grid-template-columns: 1fr;
    }
    
    .popup-city__title {
        font-size: 18px;
    }
    
    .city-search-input {
        font-size: 14px;
    }
}

/* ===== Animation on show/hide ===== */
.popup-base.show {
    display: block;
}

.popup-base.hiding {
    animation: popupFadeOut 0.3s ease forwards;
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

