/**
 * Taifa Mpya - Popup Modal Stylesheet
 * Premium NGO style modal with smooth animations
 */

/* ========================================
   Modal Overlay
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Modal Container
   ======================================== */
.modal {
     background: #FFFFFF;
     max-width: 500px;
     width: 100%;
     padding: 50px 44px;
     position: relative;
     text-align: center;
     transform: scale(0.8) translateY(20px);
     transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
     border-radius: 20px;
     box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
     border: 1px solid rgba(255, 255, 255, 0.1);
 }

 .modal::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     height: 4px;
     background: linear-gradient(90deg, #1B4332, #D4A024, #1B4332);
     background-size: 200% 100%;
     animation: shimmer 3s ease-in-out infinite;
     border-radius: 20px 20px 0 0;
 }

 @keyframes shimmer {
     0%, 100% { background-position: 0% 50%; }
     50% { background-position: 100% 50%; }
 }

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

/* ========================================
   Modal Close Button
   ======================================== */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(27, 67, 50, 0.08);
    color: #4A5568;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    z-index: 10;
}

.modal-close:hover {
    background: #1B4332;
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.3);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.15);
}

/* ========================================
   Modal Content
   ======================================== */
.modal-icon {
     width: 120px;
     height: 120px;
     margin: 0 auto 28px;
     overflow: hidden;
     border-radius: 50%;
     box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
     border: 3px solid #fff;
     background-color: #fff;
     position: relative;
 }
 
 .modal-icon::after {
     content: '';
     position: absolute;
     inset: -4px;
     border-radius: 50%;
     border: 2px solid rgba(27, 67, 50, 0.12);
 }
 
 .modal-icon img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     display: block;
 }

.modal-title {
     font-family: 'Playfair Display', Georgia, serif;
     font-size: 2rem;
     font-weight: 700;
     color: #1A1A1A;
     margin-bottom: 16px;
     line-height: 1.3;
     letter-spacing: -0.5px;
     position: relative;
     padding-bottom: 16px;
 }

 .modal-title::after {
     content: '';
     position: absolute;
     bottom: 0;
     left: 50%;
     transform: translateX(-50%);
     width: 60px;
     height: 3px;
     background: linear-gradient(90deg, #1B4332, #D4A024);
     border-radius: 2px;
 }

.modal-message {
     font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
     font-size: 1.05rem;
     color: #4A5568;
     line-height: 1.8;
     margin-bottom: 32px;
     max-width: 400px;
     margin-left: auto;
     margin-right: auto;
 }

/* ========================================
   Modal CTA Button
   ======================================== */
.modal-cta {
     display: inline-block;
     padding: 16px 44px;
     background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
     color: #fff;
     font-weight: 600;
     font-size: 1rem;
     letter-spacing: 0.02em;
     border: none;
     cursor: pointer;
     transition: all 0.3s ease;
     text-decoration: none;
     border-radius: 12px;
     position: relative;
     overflow: hidden;
 }

 .modal-cta::before {
     content: '';
     position: absolute;
     top: 0;
     left: -100%;
     width: 100%;
     height: 100%;
     background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
     transition: left 0.6s ease;
 }

 .modal-cta:hover::before {
     left: 100%;
 }

.modal-cta:hover {
    background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(27, 67, 50, 0.35);
}

.modal-cta:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.15);
}

/* ========================================
   Cookie Notice Variant
   ======================================== */
.modal.cookie-notice {
    max-width: 400px;
}

.modal.cookie-notice .modal {
    max-width: 400px;
    padding: 35px 30px;
    text-align: left;
}

.modal.cookie-notice .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.modal.cookie-notice .modal-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.modal.cookie-notice .modal-title::after {
    width: 40px;
}

.modal.cookie-notice .modal-message {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .modal {
        padding: 40px 24px;
        border-radius: 16px;
    }

    .modal::before {
        border-radius: 16px 16px 0 0;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-title::after {
        width: 50px;
    }

    .modal-message {
        font-size: 0.95rem;
    }

    .modal-icon {
        width: 90px;
        height: 90px;
        margin-bottom: 22px;
    }
}
