/* Convertify Modal - Frontend Styles */

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

/* Modal trigger styles */
.wootimize-modal-trigger {
    position: relative;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: currentColor;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wootimize-modal-trigger:hover {
    text-decoration-style: solid;
    opacity: 0.8;
}

/* Modal container */
.wootimize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

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

/* Overlay */
.wootimize-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

/* Modal container */
.wootimize-modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow: hidden;
    z-index: 1;
}

/* Modal content */
.wootimize-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Close button */
.wootimize-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.wootimize-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Modal header */
.wootimize-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.wootimize-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    padding-right: 40px;
}

/* Modal body */
.wootimize-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.wootimize-modal-body > *:first-child {
    margin-top: 0;
}

.wootimize-modal-body > *:last-child {
    margin-bottom: 0;
}

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

/* Fade animations */
.wootimize-modal.fade-in .wootimize-modal-container {
    animation: fadeInScale 0.3s ease;
}

.wootimize-modal.fade-out .wootimize-modal-container {
    animation: fadeOutScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Slide down animations */
.wootimize-modal.slide-down-in .wootimize-modal-container {
    animation: slideDownIn 0.3s ease;
}

.wootimize-modal.slide-down-out .wootimize-modal-container {
    animation: slideDownOut 0.3s ease;
}

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

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

/* Slide up animations */
.wootimize-modal.slide-up-in .wootimize-modal-container {
    animation: slideUpIn 0.3s ease;
}

.wootimize-modal.slide-up-out .wootimize-modal-container {
    animation: slideUpOut 0.3s ease;
}

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

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

/* Zoom animations */
.wootimize-modal.zoom-in .wootimize-modal-container {
    animation: zoomIn 0.3s ease;
}

.wootimize-modal.zoom-out .wootimize-modal-container {
    animation: zoomOut 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wootimize-modal-container {
        width: 90% !important;
        max-width: 90% !important;
        max-height: 80vh;
    }

    .wootimize-modal-header {
        padding: 20px 20px 12px;
    }

    .wootimize-modal-header h2 {
        font-size: 20px;
    }

    .wootimize-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wootimize-modal-container {
        width: 95% !important;
        max-width: 95% !important;
        border-radius: 4px;
    }

    .wootimize-modal-header h2 {
        font-size: 18px;
    }
}
