/* Modal Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    padding: 10px 20px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.modal-btn-cancel {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.modal-btn-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-btn-confirm {
    background: var(--inseit-primary);
    color: white;
    border-color: var(--inseit-primary);
}

.modal-btn-confirm:hover {
    background: var(--inseit-secondary);
    border-color: var(--inseit-secondary);
}

.modal-btn-ok {
    background: var(--inseit-primary);
    color: white;
    border-color: var(--inseit-primary);
}

.modal-btn-ok:hover {
    background: var(--inseit-secondary);
    border-color: var(--inseit-secondary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .modal-dialog {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-btn-cancel {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-btn-cancel:hover {
    background: var(--bg-secondary);
}

/* Form styles in modals */
.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--inseit-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-body .mb-4 {
    margin-bottom: 1rem;
}

/* Wider modal for forms */
.modal-dialog[style*="max-width: 600px"] {
    max-width: 600px !important;
}

/* Custom Parameters Modal specific positioning */
#custom-params-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
    padding-top: 2rem;
}

#custom-params-modal .bg-white {
    margin-top: 0;
    animation: modalSlideIn 0.2s ease-out;
}
