/**
 * display-options-accordion.css
 * Version: 1.0.0
 * Accordion styles for Display Options offcanvas panel
 */

/* Accordion container */
.display-options-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Accordion item */
.accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.accordion-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Accordion header (clickable) */
.accordion-header {
    margin: 0;
}

.accordion-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    transition: background-color 0.2s ease;
}

.accordion-button:hover {
    background: #e9ecef;
}

.accordion-button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* Icon before text */
.accordion-button .icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Chevron icon that rotates */
.accordion-button .chevron {
    transition: transform 0.2s ease;
    font-size: 1.1rem;
    color: #666;
    pointer-events: none; /* Allow clicks to pass through to button */
}

/* All children of accordion button should pass clicks through */
.accordion-button * {
    pointer-events: none;
}

.accordion-button[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* Expanded state styling */
.accordion-button[aria-expanded="true"] {
    background: #e7f1ff;
    color: #0d6efd;
}

/* Accordion body (content) */
.accordion-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-collapse.show {
    max-height: 2000px; /* Large enough for any content */
}

.accordion-body {
    padding: 1rem;
    background: #fff;
}

/* Section separator within accordion body */
.accordion-body .option-group {
    margin-bottom: 1rem;
}

.accordion-body .option-group:last-child {
    margin-bottom: 0;
}

.accordion-body h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Compact form controls */
.accordion-body .form-select,
.accordion-body .form-check {
    font-size: 0.875rem;
}

.accordion-body .btn-group {
    font-size: 0.875rem;
}

/* Special styling for first item (most important) */
.accordion-item:first-child {
    border: 2px solid #0d6efd;
}

.accordion-item:first-child .accordion-button {
    background: #e7f1ff;
    font-weight: 700;
}

.accordion-item:first-child .accordion-button:not([aria-expanded="true"]):hover {
    background: #d0e7ff;
}

/* Dark theme support */
:root[data-theme="dark"] .accordion-item {
    border-color: #495057;
    background: #2d3748;
}

:root[data-theme="dark"] .accordion-button {
    background: #374151;
    color: #e0e0e0;
}

:root[data-theme="dark"] .accordion-button:hover {
    background: #4b5563;
}

:root[data-theme="dark"] .accordion-button[aria-expanded="true"] {
    background: #1e3a5f;
    color: #6db3f2;
}

:root[data-theme="dark"] .accordion-body {
    background: #2d3748;
}

:root[data-theme="dark"] .accordion-body h6 {
    color: #d0d0d0;
}

:root[data-theme="dark"] .accordion-item:first-child {
    border-color: #6db3f2;
}

:root[data-theme="dark"] .accordion-item:first-child .accordion-button {
    background: #1e3a5f;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .accordion-button {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }

    .accordion-body {
        padding: 0.75rem;
    }
}

/* Accessibility: High contrast mode */
@media (prefers-contrast: high) {
    .accordion-item {
        border: 2px solid #000;
    }

    .accordion-button:focus {
        outline: 3px solid #000;
    }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .accordion-collapse {
        transition: none;
    }

    .accordion-button .chevron {
        transition: none;
    }
}
