/* Dialog styles for the application */

dialog {
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    min-width: 600px;
    width: auto;
    /* Center the dialog in the viewport */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

.dialog-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 85vh;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.dialog-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #6c757d;
    transition: color 0.15s ease-in-out;
}

.dialog-close:hover {
    color: #212529;
}

.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 130px); /* Adjusted to account for header and footer */
    background-color: #fff;
}

.dialog-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #f8f9fa;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Form styling inside dialogs */
.dialog-body form {
    width: 100%;
}

.dialog-body .form-row {
    margin-bottom: 1rem;
}

.dialog-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.dialog-body input,
.dialog-body select,
.dialog-body textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
}

.dialog-body input:focus,
.dialog-body select:focus,
.dialog-body textarea:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Pre element for JSON display */
.dialog-body pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 500px;
    overflow-y: auto;
}
