﻿/* Global shared edit form styles */

.anv-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

    .anv-edit-form h4 {
        margin: 0 0 1rem 0;
        padding: 0;
        font-size: 1.25rem;
        font-weight: 500;
        /* Follow the app theme (MudThemeProvider), not the browser's prefers-color-scheme,
           so the title stays legible when app dark mode and browser theme disagree. */
        color: var(--mud-palette-text-primary);
        flex-shrink: 0;
    }

/* Main scrollable content area */
.anv-edit-form > .mud-focus-trap {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
}

.anv-form-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 4px;
    background-color: var(--mud-palette-surface);
    border: none;
    border-bottom: 1px solid var(--mud-palette-divider);
    box-shadow: none;
    flex-shrink: 0;
}

/* Right panel section styling - blend with drawer background */
.right-panel .anv-form-section {
    background-color: transparent;
    border-bottom-color: var(--mud-palette-divider);
    box-shadow: none;
}

.anv-form-section.section-header {
    margin-bottom: 0;
}

    .anv-form-section.section-header .section-title {
        font-size: 0.875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--mud-palette-text-secondary);
        margin: 0;
    }

/* Two-column responsive grid layout for form fields */
.anv-form-grid {
    display: grid;
    gap: 0.75rem;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
}

@media (min-width: 600px) {
    .anv-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .anv-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.anv-form-grid.single-column {
    grid-template-columns: 1fr;
}

.anv-form-grid.full-width {
    grid-column: 1 / -1;
}

/* Field group for paired/related fields */
.anv-form-field-group {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .anv-form-field-group.row {
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }
}

.anv-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0;
    padding: 1rem;
    border-top: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    background-color: transparent;
}

.right-panel .anv-form-actions {
    border-top-color: var(--mud-palette-divider);
}

@media (max-width: 599px) {
    .anv-form-actions {
        flex-direction: column;
    }

        .anv-form-actions button {
            width: 100%;
        }
}

.form-item-tight {
    margin-bottom: 0;
}

.form-item-spacer {
    margin-bottom: 0.5rem;
}

    .form-item-spacer.large {
        margin-bottom: 1rem;
    }

/* Form action buttons styling */
.anv-form-actionbar {
    width: 100%;
    flex-shrink: 0;
}
