/* ===== СИСТЕМА ПОПАПОВ - ЧИСТЫЕ СТИЛИ ===== */

/* Базовые стили для всех попапов */
.main-popup-overlay {
    position: fixed !important;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.main-popup-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== ЦЕНТРАЛЬНЫЙ ПОПАП ===== */
.main-popup-center-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-popup-center-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.main-popup-center-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: popupSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.main-popup-center-content.main-clickable-popup {
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-popup-center-content.main-clickable-popup:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

@keyframes popupSlideIn {
    0% {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===== НИЖНИЙ ПОПАП ===== */
.main-popup-bottom-overlay {
    bottom: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.main-popup-bottom-overlay.show {
    transform: translateY(0);
}

.main-popup-bottom-container {
    width: 100%;
}

.main-popup-bottom-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.main-popup-bottom-content.main-clickable-popup {
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-popup-bottom-content.main-clickable-popup:hover {
    transform: translateY(-5px);
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.3);
}

.main-popup-bottom-inner {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ===== ВЕРХНИЙ ПОПАП ===== */
.main-popup-top-overlay {
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.main-popup-top-overlay.show {
    transform: translateY(0);
}

.main-popup-top-container {
    width: 100%;
}

.main-popup-top-content {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.main-popup-top-content.main-clickable-popup {
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-popup-top-content.main-clickable-popup:hover {
    transform: translateY(5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.main-popup-top-inner {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ===== ОБЩИЕ ЭЛЕМЕНТЫ ===== */
.main-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 10000;
}

.main-popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Специальные стили для кнопки закрытия в нижнем попапе */
.main-popup-bottom-content .main-popup-close {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.main-popup-bottom-content .main-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

/* Специальные стили для кнопки закрытия в верхнем попапе */
.main-popup-top-content .main-popup-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 30px;
    height: 30px;
    font-size: 12px;
    top: 10px;
}

.main-popup-top-content .main-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-popup-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

/* Специальные стили заголовка для нижнего и верхнего попапов */
.main-popup-bottom-inner .main-popup-title,
.main-popup-top-inner .main-popup-title {
    margin: 0;
    font-size: 18px;
    text-align: left;
    flex: 0 0 auto;
}

.main-popup-top-inner .main-popup-title {
    color: white;
}

.main-popup-body {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
}

/* Специальные стили тела для нижнего и верхнего попапов */
.main-popup-bottom-inner .main-popup-body,
.main-popup-top-inner .main-popup-body {
    margin-bottom: 0;
    flex: 1;
    line-height: 1.4;
    font-size: 14px;
}

.main-popup-top-inner .main-popup-body {
    color: rgba(255, 255, 255, 0.9);
}

.main-popup-top-inner .main-popup-body * {
    color: inherit !important;
}

.main-popup-actions {
    text-align: center;
}

/* Специальные стили действий для нижнего и верхнего попапов */
.main-popup-bottom-inner .main-popup-actions,
.main-popup-top-inner .main-popup-actions {
    flex: 0 0 auto;
}

.main-popup-button {
    display: inline-block;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    border: none;
}

.main-popup-button:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

/* Специальные стили кнопки для нижнего попапа */
.main-popup-bottom-inner .main-popup-button {
    background: linear-gradient(45deg, #28a745, #20c997);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.main-popup-bottom-inner .main-popup-button:hover {
    background: linear-gradient(45deg, #218838, #1cc88a);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Специальные стили кнопки для верхнего попапа */
.main-popup-top-inner .main-popup-button {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.main-popup-top-inner .main-popup-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .main-popup-center-content {
        padding: 20px;
        margin: 20px;
    }
    
    .main-popup-title {
        font-size: 20px;
    }

    .main-popup-bottom-inner,
    .main-popup-top-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    
    .main-popup-bottom-inner .main-popup-title,
    .main-popup-top-inner .main-popup-title {
        font-size: 16px;
    }
    
    .main-popup-bottom-inner .main-popup-actions,
    .main-popup-top-inner .main-popup-actions {
        width: 100%;
        text-align: center;
    }
    
    .main-popup-bottom-inner .main-popup-button,
    .main-popup-top-inner .main-popup-button {
        width: 100%;
        text-align: center;
    }
}
