/* Modal Component Styles */

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

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
    padding: 20px;
}

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

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

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

/* Modal Sizes */
.modal-small {
    width: 100%;
    max-width: 500px;
}

.modal-medium {
    width: 100%;
    max-width: 800px;
}

.modal-large {
    width: 100%;
    max-width: 1200px;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 2px solid #eee;
    background: #f9f9f9;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #181948;
}

.modal-close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: #e0e0e0;
    color: #181948;
}

.modal-close-btn:active {
    transform: scale(0.95);
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    min-height: 500px;
}

/* Large modal gets full viewport height */
.modal-large {
    width: 100%;
    max-width: 1200px;
    max-height: 95vh;
}

.modal-large .modal-iframe {
    min-height: calc(95vh - 80px); /* Full height minus header */
}

/* Responsive */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-container {
        max-height: 95vh;
        border-radius: 8px;
    }

    .modal-small,
    .modal-medium,
    .modal-large {
        max-width: 100%;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 18px;
    }
}

/* Nested Modals - increase z-index for stacking */
.modal-overlay:nth-of-type(2) {
    background: rgba(0, 0, 0, 0.7);
}

.modal-overlay:nth-of-type(3) {
    background: rgba(0, 0, 0, 0.8);
}
