/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(6, 6, 11, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    margin: auto;
    padding: clamp(1.5rem, 4vw, 3rem);
    width: min(90%, 800px);
    border-radius: 24px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    background: none;
    border: none;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--accent-teal);
}

.modal-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h2 {
    font-size: 2.5rem;
    margin: 0;
}

.modal-body h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 600;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

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

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

[data-theme="light"] .modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal {
    background-color: rgba(247, 247, 250, 0.8);
}