/* Modal Overlay Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black-alpha-80);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-overlay.show {
    display: block;
}

.modal-content {
    position: relative;
    background: var(--white);
    margin: 50px auto;
    max-width: 900px;
    border-radius: 20px;
    box-shadow: 0 25px 50px var(--black-alpha-50);
    animation: slideIn 0.3s ease-out;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 30px 40px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Legal Content Styles for Modals */
.modal-body .legal-content {
    background: transparent;
    border-radius: 0;
    padding: 0 0 30px 0;
    box-shadow: none;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.modal-body .legal-content:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

.modal-body .legal-content h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 600;
    border-bottom: 2px solid var(--neutral-medium);
    padding-bottom: 10px;
}

.modal-body .legal-content h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    margin-top: 25px;
    font-weight: 600;
}

.modal-body .legal-content p {
    color: var(--neutral-darker);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.modal-body .legal-content p:last-child {
    margin-bottom: 0;
}

/* Contact Information Styling in Modal */
.modal-body .contact-info {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
}

.modal-body .contact-info p {
    color: var(--white);
    margin-bottom: 8px;
}

.modal-body .contact-info p:last-child {
    margin-bottom: 0;
}

/* Highlight Boxes in Modal */
.modal-body .highlight-box {
    background: linear-gradient(135deg, var(--primary-alpha-10) 0%, var(--primary-alpha-20) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.modal-body .highlight-box p {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

/* Contact Button in Modal */
.contact-button {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-alpha-30);
    margin-top: 10px;
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-alpha-50);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.contact-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--primary-alpha-30);
}

/* List Styling in Modal */
.modal-body .legal-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body .legal-content li {
    color: var(--neutral-darker);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Links in Modal */
.modal-body a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-body a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px 25px;
        border-radius: 15px 15px 0 0;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-close {
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }
    
    .modal-body {
        padding: 25px;
        max-height: calc(100vh - 140px);
    }
    
    .modal-body .legal-content h3 {
        font-size: 1.3rem;
    }
    
    .modal-body .legal-content h4 {
        font-size: 1.1rem;
    }
    
    .modal-body .contact-info {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-body .legal-content h3 {
        font-size: 1.2rem;
    }
}

/* Scrollbar Styling for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--neutral-light);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}