/* Dialog Overlay - common base for both dialogs */
.file-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Main dialog container */
.file-dialog {
    background-color: var(--bg-lightest);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    width: 500px;
    max-width: 90vw;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Dialog header */
.file-dialog-header {
    padding: 12px;
    background: linear-gradient(to right, var(--bg-light), var(--bg-mid));
    border-bottom: 1px solid var(--border-light);
    color: var(--purple-dark);
    font-weight: bold;
}

/* Dialog body */
.file-dialog-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--text-light);
}

/* Navigation section */
.file-dialog-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-button {
    padding: 4px 8px;
    background: linear-gradient(to bottom, var(--bg-light), var(--bg-mid));
    border: 1px solid var(--border-light);
    color: var(--purple-dark);
    border-radius: 4px;
    cursor: pointer;
}

.nav-button:hover {
    background: linear-gradient(to bottom, var(--bg-mid), var(--border-light));
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: default;
    background: #f0f0f0;
}

.current-path {
    flex-grow: 1;
    padding: 4px 8px;
    background-color: var(--text-light);
    border: 1px solid var(--border-light);
    color: var(--purple-dark);
    border-radius: 4px;
    font-family: monospace;
}

/* File list container */
.file-dialog-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-dialog .file-list {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    background-color: var(--text-light);
    border-radius: 4px;
    padding: 4px;
}

/* File items within dialog */
.file-dialog .file-item {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--purple-dark);
    border: 1px solid transparent;
    border-radius: 2px;
}

.file-dialog .file-item:hover {
    background-color: var(--bg-mid-transparent);
    border-color: var(--border-light);
}

.file-dialog .file-item.selected {
    background-color: var(--text-light-transparent);
    border-color: var(--border-dark);
}

.file-dialog .folder-icon,
.file-dialog .file-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Save dialog specific styles */
.save-input {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
}

.filename-input {
    flex-grow: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--purple-dark);
    font-size: 14px;
}

.filename-input:focus {
    border-color: var(--border-dark);
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-dark-transparent);
}

/* Dialog footer */
.file-dialog-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-lightest);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Dialog buttons */
.file-dialog-footer button {
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background: linear-gradient(to bottom, var(--bg-light), var(--bg-mid));
    color: var(--purple-dark);
    min-width: 80px;
}

.file-dialog-footer button:hover:not(:disabled) {
    background: linear-gradient(to bottom, var(--bg-mid), var(--border-light));
}

.file-dialog-footer button:disabled {
    opacity: 0.5;
    cursor: default;
    background: var(--nav-button-disabled);
}

/* Scrollbar styling */
.file-dialog .file-list::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.file-dialog .file-list::-webkit-scrollbar-track {
    background: var(--bg-lightest);
    border-left: 1px solid var(--border-light);
}

.file-dialog .file-list::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border: 3px solid var(--bg-lightest);
    border-radius: 8px;
}

.file-dialog .file-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-dark);
}

/* Firefox scrollbar */
.file-dialog .file-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-lightest);
}