/* استایل پاپ‌آپ شرایط ابطال */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    padding: 20px;
}

.popup-container {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--secondary-color-1);
    animation: popup-appear 0.5s ease;
    margin: 20px;
    display: flex;
    flex-direction: column;
}

@keyframes popup-appear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    flex-shrink: 0;
}

.popup-title {
    color: var(--light-text);
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
    width: 100%;
}

.popup-close {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) rotate(90deg);
}

.popup-content {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    max-width: 95%;
    border: 1px solid rgba(199, 166, 98, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    flex: 1;
    margin: 15px auto;
    position: relative;
    min-height: 200px; /* حداقل ارتفاع */
}

.popup-text {
    color: var(--light-text);
    line-height: 1.7;
    width: 100%;
    text-align: justify;
    position: relative;
}

.popup-text p {
    margin-bottom: 15px;
}

.cancellation-list {
    margin: 15px 0;
    padding-right: 20px;
    width: 100%;
}

.cancellation-list li {
    margin-bottom: 10px;
    position: relative;
}

.cancellation-list li::before {
    content: "•";
    color: var(--secondary-color-1);
    font-weight: bold;
    position: absolute;
    right: -15px;
}

.footnotes {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    margin-bottom: 60px; /* فضای برای دکمه مشاهده کمتر */
}

.footnotes p {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* دکمه مشاهده بیشتر/کمتر */
.toggle-text-btn {
    position: absolute;
    bottom: -20;
    left: 50%;
    transform: translateX(-50%);
    width: auto !important;
    min-width: 180px;
    padding: 10px 30px !important;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: bottom;
    gap: 8px;
    z-index: 10;
}

.toggle-text-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-50%) translateY(-2px);
}

/* وقتی متن کامل نمایش داده می‌شود، دکمه به پایین منتقل می‌شود */
.popup-text.expanded .toggle-text-btn {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 20px auto 10px;
    display: block;
}

/* بخش برای دکمه‌ها - خارج از محتوا */
.popup-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
}

.btn-primary {
    background: var(--secondary-color-1);
    color: var(--text-color);
    bottom: 20px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--light-text);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--light-text);
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
    margin: 10px 0;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color-1);
}

/* رسپانسیو */
@media (max-width: 768px) {
    .popup-container {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .popup-header {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 1.2rem;
    }
    
    .popup-content {
        padding: 15px;
        margin: 10px auto;
    }
    
    .popup-footer {
        padding: 15px;
    }
    
    .popup-actions {
        gap: 12px;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 0.95rem;
        max-width: 280px;
    }
    
    .toggle-text-btn {
        min-width: 160px;
        padding: 8px 16px !important;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 98%;
        border-radius: 10px;
        margin: 5px;
        max-height: 95vh;
    }
    
    .popup-header {
        padding: 12px;
    }
    
    .popup-title {
        font-size: 1.1rem;
    }
    
    .popup-content {
        padding: 12px;
        margin: 8px auto;
    }
    
    .popup-footer {
        padding: 12px;
    }
    
    .popup-text {
        font-size: 0.9rem;
    }
    
    .checkbox-container {
        font-size: 0.9rem;
    }
    
    .toggle-text-btn {
        min-width: 140px;
        padding: 6px 12px !important;
        font-size: 0.9rem;
    }
    
    .btn {
        max-width: 250px;
        padding: 8px 20px;
    }
    
    .popup-close {
        left: 12px;
        width: 35px;
        height: 35px;
    }
}