/**
 * CollapsibleSection Component Styles
 * Medtronic Design System compliant
 */

.collapsible-section {
    margin-bottom: 16px;
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    border-radius: 8px;
    background-color: var(--neutral-layer-2, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.section-header:hover {
    background-color: var(--neutral-layer-3, #f5f5f5);
}

.section-header:focus {
    outline: 2px solid var(--medtronic-primary-blue, #0066CC);
    outline-offset: -2px;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-foreground-rest, #242424);
    flex-shrink: 0;
}

/* Section content with smooth collapse/expand animation */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.section-content.expanded {
    max-height: 10000px; /* Large enough for any content */
    transition: max-height 0.5s ease-in;
}

.section-body {
    padding: 16px;
    /* Let child elements (like .fields-grid) control their own grid layout */
    /* Don't apply grid here to avoid conflicts with DynamicFieldsRenderer */
}

/* Badges styling */
fluent-badge {
    font-size: 12px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-body {
        padding: 12px;
    }

    .section-header {
        padding: 12px;
    }

    .section-title {
        font-size: 16px;
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .section-content {
        transition: none;
    }

    .section-header {
        transition: none;
    }
}

/* Print styles: Always expand sections when printing */
@media print {
    .collapsible-section {
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .section-content {
        max-height: none !important;
        overflow: visible !important;
    }

    .section-header {
        cursor: default;
    }
}
