/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

/* Ensure modal appears above everything */
.modal {
    z-index: 999999 !important;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(50px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: #000000;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333333;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    line-height: 1.6;
}

.modal-body h3 {
    color: #000000;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid #000000;
    padding-bottom: 0.5rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body h4 {
    color: #333333;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.modal-body p {
    margin-bottom: 1rem;
    color: #444444;
    font-size: 0.95rem;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: #444444;
    font-size: 0.95rem;
}

.modal-body strong {
    color: #000000;
    font-weight: 600;
}

.close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.close:hover,
.close:focus {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Footer Legal Links */
.footer-legal {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.legal-link {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-link:hover {
    color: #000000;
    text-decoration: underline;
}

.footer-legal span {
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 80px);
    }
    
    .modal-body h3 {
        font-size: 1.1rem;
    }
    
    .modal-body h4 {
        font-size: 1rem;
    }
    
    .modal-body p,
    .modal-body li {
        font-size: 0.9rem;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-legal span {
        display: none;
    }
}

/* Smooth scrolling for modal content */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #000000 #f1f1f1;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
}