/**
 * FormTheme Accordion Styling
 * Provides collapsible accordion interface for theme styling sections
 */

/* Accordion Wrapper */
.griffinforms-accordion-wrapper {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Accordion Items */
.griffinforms-accordion-item {
    border-bottom: 1px solid #dee2e6;
    background-color: #fff;
    transition: all 0.3s ease;
}

.griffinforms-accordion-item:last-child {
    border-bottom: none;
}

/* Accordion Header */
.griffinforms-accordion-header {
    margin: 0;
    padding: 0;
}

.griffinforms-accordion-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: #fff;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
    transition: all 0.3s ease;
    overflow: visible;
    gap: 1rem;
}

.griffinforms-accordion-button:hover {
    background-color: #f8f9fa;
    color: #1d2327;
}

.griffinforms-accordion-button:focus {
    outline: none;
    box-shadow: inset 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Accordion Title and Icon */
.griffinforms-accordion-button .accordion-title {
    flex: 1 1 auto;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.griffinforms-accordion-button .accordion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    padding: 0;
    transition: transform 0.3s ease;
    color: #6c757d;
    font-size: 1.25rem;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    visibility: visible;
}

.griffinforms-accordion-button .accordion-icon i {
    display: inline-block;
    line-height: 1;
}

.griffinforms-accordion-button[data-expanded="true"] .accordion-icon {
    transform: rotate(0deg);
}

.griffinforms-accordion-button[data-expanded="false"] .accordion-icon {
    transform: rotate(-90deg);
}

/* Accordion Description */
.griffinforms-accordion-description {
    padding: 0 1.25rem 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    font-style: italic;
}

/* Accordion Collapse */
.griffinforms-accordion-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.griffinforms-accordion-collapse.show {
    max-height: 50000px;
    transition: max-height 0.4s ease;
}

/* Accordion Body */
.griffinforms-accordion-body {
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Remove container styling from content sections */
.griffinforms-accordion-body .container {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
}

.griffinforms-accordion-body .container.border-bottom {
    border-bottom: none !important;
}

.griffinforms-accordion-body .griffinforms-item-options {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
    width: 100% !important;
    background-color: transparent !important;
}

.griffinforms-accordion-body .griffinforms-item-options:last-child {
    margin-bottom: 0 !important;
}

/* Preview buttons */
.griffinforms-accordion-body .griffinforms-preview-btn {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .griffinforms-accordion-wrapper {
        max-width: 100%;
    }

    .griffinforms-accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .griffinforms-accordion-description {
        padding: 0 1rem 0.5rem 1rem;
        font-size: 0.8125rem;
    }

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

/* Animation tweaks */
@media (prefers-reduced-motion: reduce) {
    .griffinforms-accordion-button,
    .griffinforms-accordion-collapse,
    .griffinforms-accordion-button .accordion-icon {
        transition: none;
    }
}
