.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    z-index: 9999;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: var(--modal-background);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10000;
}

.modal-header {
    padding: 20px 24px;
    background: var(--panel-header-background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
}

.close-modal:hover {
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    background: var(--modal-background);
}

.modal-body pre {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-footer {
    padding: 20px;
    background: var(--modal-background);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 20px 20px;
}

.modal-footer button {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-footer .btn-secondary,
.modal-footer .secondary {
    background: var(--input-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-footer .btn-primary,
.modal-footer button:not(.btn-secondary):not(.secondary) {
    background: var(--primary-color);
    color: white;
    border: none;
}

.modal-footer .btn-secondary:hover {
    background: var(--button-hover-bg);
    border-color: var(--button-hover-border);
}

.modal-footer .btn-primary:hover {
    background: var(--primary-hover);
}

.modal-footer button:active {
    transform: translateY(1px);
}

#deleteConfirmationModal .modal-body {
    text-align: center;
    padding: 2rem;
}

#deleteConfirmationModal .modal-body p:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

#deleteResourceName {
    font-weight: 600;
    color: var(--text-primary);
}

.modal input[type="text"],
.modal input[type="number"] {
    background: var(--input-background);
    color: var(--input-text);
    border: 1px solid var(--border-color);
}

.modal input[type="text"]:focus,
.modal input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.modal input[type="text"]::placeholder,
.modal input[type="number"]::placeholder {
    color: var(--input-placeholder);
}

.modal label {
    color: var(--text-primary);
}

#addAliasBtn {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

#addAliasBtn:hover {
    background-color: var(--primary-hover);
}

#aliasModal .modal-body input {
    background-color: var(--input-background);
    color: var(--input-text);
    border: 1px solid var(--input-border);
}

#aliasModal .modal-header h3 {
    color: var(--text-primary);
}

#aliasModal .modal-body label {
    color: var(--text-primary);
}

#addDocumentModal .document-field {
    background-color: var(--modal-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

#addDocumentModal .document-field input {
    background-color: var(--input-background);
    color: var(--input-text);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0.75rem;
    width: 100%;
}

#addDocumentModal .document-field input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
    outline: none;
}

#addDocumentModal .document-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

#documentJson {
    background-color: var(--input-background);
    color: var(--input-text);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    padding: 1rem;
    min-height: 200px;
    width: 100%;
}

.field-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    background-color: var(--badge-bg);
    color: var(--badge-text);
}

.field-type.short {
    background-color: var(--info-bg);
    color: var(--info-color);
}

.field-type.text {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.field-type.date {
    background-color: var(--primary-bg);
    color: var(--primary-color);
}

[data-theme="dark"] #addDocumentModal .modal-content {
    background-color: var(--modal-background);
}

[data-theme="dark"] #addDocumentModal .modal-header {
    background-color: var(--panel-header-background);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] #addDocumentModal .modal-body {
    background-color: var(--modal-background);
}

[data-theme="dark"] #addDocumentModal .modal-footer {
    background-color: var(--modal-background);
    border-top: 1px solid var(--border-color);
} 