/**
 * ProjectFormLayout.razor Styles
 * Story 12.3: Layout and orchestration styling for unified project forms
 * Medtronic Design System compliant
 */

/* ===== Main Container ===== */
.project-form-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 96px 16px; /* Bottom padding for sticky action bar */
}

/* ===== Form Sections Container ===== */
.form-sections {
    display: flex;
    flex-direction: column;
    gap: 24px; /* Medtronic 8px grid: 3 units */
    padding: 16px 0;
}

/* ===== Section Fields Grid (Responsive) ===== */
.section-fields {
    display: grid;
    gap: 16px; /* 2 units */
    grid-template-columns: 1fr; /* Mobile: 1 column */
    padding: 16px;
}

/* Tablet: 2 columns (768px+) */
@media (min-width: 768px) {
    .section-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns (1200px+) */
@media (min-width: 1200px) {
    .section-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Field Placeholder (Story 12.3 - removed in Story 12.4) ===== */
.field-placeholder {
    padding: 12px;
    background-color: var(--neutral-layer-2, #f5f5f5);
    border: 1px dashed var(--neutral-stroke-rest, #ccc);
    border-radius: 4px;
    font-size: 14px;
    color: var(--neutral-foreground-rest, #666);
    text-align: center;
}

/* ===== Sticky Action Bar ===== */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--neutral-layer-1, #ffffff);
    border-top: 2px solid var(--medtronic-primary-blue, #0066CC);
    padding: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure buttons have consistent sizing */
.sticky-action-bar fluent-button {
    min-width: 120px;
    height: 40px;
}

/* ===== Responsive Adjustments ===== */

/* Mobile (<768px): Stack buttons vertically */
@media (max-width: 767px) {
    .sticky-action-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .sticky-action-bar fluent-button {
        width: 100%;
        min-width: unset;
    }

    .project-form-layout {
        padding-bottom: 120px; /* More space for stacked buttons */
    }
}

/* Tablet (768px-1199px): Horizontal layout with smaller gap */
@media (min-width: 768px) and (max-width: 1199px) {
    .sticky-action-bar {
        padding: 14px;
        gap: 10px;
    }
}

/* ===== Accessibility ===== */

/* Focus indicator for action bar (keyboard navigation) */
.sticky-action-bar:focus-within {
    outline: 2px solid var(--medtronic-primary-blue, #0066CC);
    outline-offset: -4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sticky-action-bar {
        border-top-width: 3px;
    }

    .field-placeholder {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-sections,
    .section-fields,
    .sticky-action-bar {
        transition: none;
    }
}

/* ===== Loading State (Saving) ===== */
.sticky-action-bar fluent-button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress ring in Save button */
.sticky-action-bar fluent-progress-ring {
    display: inline-block;
    vertical-align: middle;
}
