/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85); /* Black w/ opacity */
}

/* Show the modal when active */
.modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.modal__content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(236, 55, 80, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 40px var(--shadow-color);
    -webkit-overflow-scrolling: touch;
}

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

.modal__close {
    color: var(--accent-color);
    float: right;
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 20px 25px 0 0;
    transition: color 0.3s ease;
}

.modal__close:hover,
.modal__close:focus {
    color: var(--secondary-accent);
}

.modal__title {
    margin: 0;
    padding: 30px 30px 10px;
    color: var(--accent-color);
    font-size: 28px;
    font-weight: 700;
    border-bottom: 2px solid rgba(236, 55, 80, 0.3);
}

.modal__body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    line-height: 1.7;
}

.modal__body h3 {
    color: var(--accent-color);
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.modal__body p {
    margin: 12px 0;
    color: var(--text-color); /* Was #e0e0e0, might be too light in light mode */
    font-size: 15px;
    opacity: 0.9;
}

.modal__body ul {
    margin: 12px 0;
    padding-left: 25px;
}

.modal__body li {
    margin: 8px 0;
    color: var(--text-color);
    opacity: 0.9;
    font-size: 15px;
}

.modal__body strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Scrollbar styling for modal body */
.modal__body::-webkit-scrollbar {
    width: 8px;
}

.modal__body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb {
    background: #ec3750;
    border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
    background: #ff5570;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal__content {
        width: 95%;
        margin: 10% auto;
        max-height: 80vh;
    }
    
    .modal__title {
        font-size: 24px;
        padding: 20px 20px 10px;
    }
    
    .modal__body {
        padding: 20px;
        max-height: calc(80vh - 100px);
    }
    
    .modal__close {
        font-size: 28px;
        padding: 15px 20px 0 0;
    }
}

@media (max-width: 480px) {
    .modal__content {
        width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
        max-height: 92vh;
        position: fixed;
        bottom: 0;
        left: 0;
    }
    
    .modal__title {
        font-size: 20px;
        padding: 15px;
    }
    
    .modal__body {
        padding: 15px;
        max-height: calc(92vh - 90px);
    }
    
    .modal__body h3 {
        font-size: 18px;
    }
    
    .modal__body p,
    .modal__body li {
        font-size: 14px;
    }
}
