/* ============================================
   MODAL POPUP SYSTEEM
   ============================================ */

.page-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.page-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    width: 95%;
    height: 90%;
    max-width: 1400px;
    background: #0a0a0a;
    border: 2px solid #FF2D55;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.3s ease;
}

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

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

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #FF2D55, #FF6B9D);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title i {
    font-size: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.modal-btn i {
    font-size: 16px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    transform: rotate(90deg) scale(1.2);
    color: #ffcccc;
}

/* Modal Content */
.modal-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #0f0f0f;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0f0f0f;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-iframe.loaded {
    opacity: 1;
}

/* Loading Spinner */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 45, 85, 0.2);
    border-top-color: #FF2D55;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .modal-title {
        font-size: 18px;
        flex: 1;
    }
    
    .modal-actions {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }
    
    .modal-btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .close-modal {
        font-size: 24px;
    }
}
