/* ========================================
   NATIVE WORDPRESS MODAL POPUP SYSTEM
   Replacement for PowerPack Modals
   ======================================== */

/* Modal Overlay */
.cz-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cz-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.cz-modal {
    position: relative;
    background: #efebe1;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cz-modal-overlay.active .cz-modal {
    transform: scale(1);
    opacity: 1;
}

/* Modal Header */
.cz-modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px 50px 20px 20px;
    border-bottom: 1px solid rgba(6, 73, 51, 0.1);
    background: #efebe1;
}

.cz-modal-title {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #064933;
}

/* Modal Close Button */
.cz-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 11;
    outline: none;
    transform: none !important;
}

.cz-modal-close:focus {
    outline: 2px solid #064933;
    outline-offset: 2px;
    background-color: rgba(6, 73, 51, 0.1);
}

.cz-modal-close:focus:not(:focus-visible) {
    outline: none;
}

.cz-modal-close:active {
    transform: none !important;
}

.cz-modal-close:hover {
    background-color: rgba(6, 73, 51, 0.1);
}

.cz-modal-close::before,
.cz-modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #064933;
    transition: background-color 0.2s ease;
}

.cz-modal-close::before {
    transform: rotate(45deg);
}

.cz-modal-close::after {
    transform: rotate(-45deg);
}

.cz-modal-close:hover::before,
.cz-modal-close:hover::after {
    background-color: #043322;
}

/* Modal Body */
.cz-modal-body {
    padding: 20px 20px 40px 20px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
    background: #efebe1;
    color: #064933;
}

.cz-modal-body h1,
.cz-modal-body h2,
.cz-modal-body h3,
.cz-modal-body h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #064933;
    font-weight: 700;
}

.cz-modal-body h1 {
    font-size: 28px;
}

.cz-modal-body h2 {
    font-size: 24px;
}

.cz-modal-body h3 {
    font-size: 20px;
}

.cz-modal-body h4 {
    font-size: 18px;
}

.cz-modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #064933;
}

.cz-modal-body ul,
.cz-modal-body ol {
    margin-bottom: 15px;
    padding-left: 25px;
    color: #064933;
}

.cz-modal-body li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #064933;
}

.cz-modal-body a {
    color: #064933;
    text-decoration: underline;
    font-weight: 500;
}

.cz-modal-body a:hover {
    color: #043322;
}

.cz-modal-body strong {
    font-weight: 700;
    color: #064933;
}

/* Modal Trigger Links */
.cz-modal-trigger {
    cursor: pointer;
    color: #064933;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.cz-modal-trigger:hover {
    color: #043322;
}

/* Responsive Styles */
@media only screen and (max-width: 1024px) {
    .cz-modal {
        max-width: 95%;
        width: 95%;
        max-height: 85vh;
    }

    .cz-modal-body {
        padding: 15px 15px 35px 15px;
        max-height: calc(85vh - 80px);
    }

    .cz-modal-title {
        font-size: 20px;
    }

    .cz-modal-header {
        padding: 15px 45px 15px 15px;
    }
}

@media only screen and (max-width: 768px) {
    .cz-modal {
        max-height: 90vh;
        border-radius: 8px 8px 0 0;
    }

    .cz-modal-body {
        padding: 15px 15px 30px 15px;
        max-height: calc(90vh - 70px);
    }

    .cz-modal-title {
        font-size: 18px;
    }
}

/* Prevent body scroll when modal is open */
body.cz-modal-open {
    overflow: hidden;
}

/* Custom scrollbar for modal body */
.cz-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cz-modal-body::-webkit-scrollbar-track {
    background: rgba(6, 73, 51, 0.1);
    border-radius: 4px;
}

.cz-modal-body::-webkit-scrollbar-thumb {
    background: rgba(6, 73, 51, 0.3);
    border-radius: 4px;
}

.cz-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 73, 51, 0.5);
}

/* Animation for modal entrance */
@keyframes czModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes czModalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.7);
    }
}
