/* ===========================
   Modal Overlay
   =========================== */
.modal {
    display: none; /* Hidden by default; JS sets flex when open */
    position: fixed;
    z-index: 12000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ===========================
   Modal Box
   =========================== */
.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    flex-shrink: 0;
    margin: auto;
}

/* ===========================
   Modal Header
   =========================== */
.modal-content h2 {
    text-align: center;
    margin: 0 0 8px 0;
    flex-shrink: 0;
    font-size: 1.35rem;
    color: #15324B;
    font-weight: 600;
    line-height: 1.3;
}

/* ===========================
   Modal Text Area
   =========================== */
.modal-text {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-text p {
    text-align: left;
    line-height: 1.5;
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    font-weight: 400;
}

.modal-text p:last-of-type {
    margin-bottom: 0;
}

.modal-text a {
    color: var(--primary-color);
    word-break: break-word;
}

/* ===========================
   Modal Buttons
   =========================== */
.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Wrap buttons on small screens */
    flex-shrink: 0;
}

/* Common button styles */
.modal-buttons button {
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 20px;
    cursor: pointer;
    transition: 0.3s;
}

/* Agree Button */
#agreeBtn { 
    background-color: var(--primary-color); 
    color: #fff; 
}
#agreeBtn:hover {
    background-color: #1e40b0;
}

/* Not Agree Button */
#notAgreeBtn { 
    background-color: transparent; 
    color: var(--primary-color); 
    border: 1px solid var(--primary-color);
}
#notAgreeBtn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ===========================
   Custom Scrollbar for modal-text
   =========================== */
/* Chrome, Edge, Safari */
.modal-text::-webkit-scrollbar {
    width: 4px; /* Slim scrollbar */
}
.modal-text::-webkit-scrollbar-track {
    background: transparent;
}
.modal-text::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* Firefox */
.modal-text {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #ffffff;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .modal {
        padding: 12px;
        align-items: flex-start;
    }
    .modal-content {
        max-width: 100%;
        padding: 20px 16px;
        max-height: calc(100vh - 24px);
    }
    .modal-content h2 {
        font-size: 1.2rem;
    }
    .modal-text p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    .modal-content {
        padding: 16px 12px;
    }
    .modal-content h2 {
        font-size: 1.1rem;
    }
    .modal-text p {
        font-size: 0.875rem;
    }
    .modal-buttons {
        gap: 10px;
    }
    .modal-buttons button {
        font-size: 14px;
        padding: 10px 16px;
    }
}
