/**
 * Solution Tabs / Accordion Styles
 *
 * Desktop: Horizontal tabs with content panels
 * Mobile: Accordion layout using details/summary
 *
 * @package Batao
 * @since 1.0.0
 */

/* CSS Variables */
:root {
    --batao-tabs-border-color: #E0DCF0;
    --batao-tabs-active-color: #F81951;
    --batao-tabs-text-color: var(--wp--preset--color--contrast, #353565);
    --batao-tabs-bg: transparent;
    --batao-tabs-content-bg: #FFFFFF;
    --batao-tabs-radius: 8px;
    --batao-tabs-gap: 32px;
}

/* ================================
   Tab Container
   ================================ */
.batao-solution-tabs {
    width: 100%;
    margin: 0 auto;
}

/* ================================
   Tab Navigation (Desktop)
   ================================ */
.batao-tabs-nav {
    display: flex;
    justify-content: center;
    gap: var(--batao-tabs-gap);
    margin-bottom: 40px;
    padding: 0 0 16px 0;
    list-style: none;
    border-bottom: 1px solid rgba(134, 134, 175, 0.25);
}

.batao-tab-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 14px;
    background: none;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 25px;
    font-weight: 700;
    line-height: 42px;
    letter-spacing: 0;
    color: var(--batao-tabs-text-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    outline: none;
}

.batao-tab-button:focus,
.batao-tab-button:focus-visible {
    outline: none;
}

.batao-tab-button:hover {
    background-color: var(--wp--preset--color--background-orange, #F6BE9B);
}

.batao-tab-button[aria-selected="true"] {
    background-color: var(--wp--preset--color--background-orange, #F6BE9B);
}

/* Version Badge */
.batao-tab-button {
    position: relative;
}

.batao-version-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--batao-tabs-active-color);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1.4;
}

@media (min-width: 769px) {
    .batao-version-badge {
        position: absolute;
        top: -8px;
        right: -20px;
    }
}

/* ================================
   Tab Panels (Desktop)
   ================================ */
.batao-tabs-content {
    position: relative;
}

.batao-tab-panel {
    display: none;
}

.batao-tab-panel[aria-hidden="false"] {
    display: block;
}

.batao-tab-panel-content {
    /* Content inherits WordPress block styles */
}

/* ================================
   Accordion (Mobile)
   ================================ */
.batao-accordion {
    display: none;
}

.batao-accordion-item {
    border-bottom: 1px solid rgba(134, 134, 175, 0.25);
}

.batao-accordion-item:first-child {
    border-top: 1px solid rgba(134, 134, 175, 0.25);
}

.batao-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--batao-tabs-text-color);
    cursor: pointer;
    list-style: none;
}

.batao-accordion-header::-webkit-details-marker {
    display: none;
}

.batao-accordion-header:focus,
.batao-accordion-header:focus-visible {
    outline: none;
}

.batao-accordion-header::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23353565' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.batao-accordion-item[open] .batao-accordion-header::after {
    transform: rotate(180deg);
}

.batao-accordion-header-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batao-accordion-content {
    padding: 0 0 16px;
}

/* ================================
   FAQ Styling within Tabs
   ================================ */
.batao-solution-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batao-solution-faq-item {
    background-color: #FFFFFF;
    border: 1px solid var(--batao-tabs-border-color);
    border-radius: var(--batao-tabs-radius);
    overflow: hidden;
}

.batao-solution-faq-item[open] {
    background-color: var(--wp--preset--color--contrast, #353565);
}

.batao-solution-faq-item[open] .batao-solution-faq-question {
    color: #FFFFFF;
}

.batao-solution-faq-item[open] .batao-solution-faq-question::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.batao-solution-faq-item[open] .batao-solution-faq-answer {
    color: #FFFFFF;
}

.batao-solution-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 25px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--batao-tabs-text-color);
    cursor: pointer;
    list-style: none;
    transition: color 0.3s ease;
}

.batao-solution-faq-question::-webkit-details-marker {
    display: none;
}

.batao-solution-faq-question::after {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23353565' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.batao-solution-faq-item[open] .batao-solution-faq-question::after {
    transform: rotate(180deg);
}

.batao-solution-faq-answer {
    padding: 0 25px 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--batao-tabs-text-color);
    transition: color 0.3s ease;
}

.batao-solution-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ================================
   Changelog Styling
   ================================ */
.batao-solution-changelog {
    font-size: 15px;
    line-height: 1.7;
}

.batao-solution-changelog h3,
.batao-solution-changelog h4 {
    margin-top: 24px;
    margin-bottom: 12px;
}

.batao-solution-changelog h3:first-child,
.batao-solution-changelog h4:first-child {
    margin-top: 0;
}

.batao-solution-changelog ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.batao-solution-changelog li {
    margin-bottom: 8px;
}

/* ================================
   Responsive - Mobile Accordion
   ================================ */
@media (max-width: 768px) {
    .batao-tabs-nav,
    .batao-tabs-content {
        display: none;
    }

    .batao-accordion {
        display: block;
    }
}

/* ================================
   Desktop Only
   ================================ */
@media (min-width: 769px) {
    .batao-accordion {
        display: none !important;
    }

    .batao-tabs-nav,
    .batao-tabs-content {
        display: flex;
    }

    .batao-tabs-content {
        display: block;
    }
}
