/* mytheraspace — spec-groups-filter.css
 *
 * Shared mobile pieces that are NOT part of the #mobileApp shell, extracted from
 * mobile.css so pages can load them without pulling in 124 KB of shell CSS.
 * Rendered by js/shared/spec-groups-filter.js (the specialty accordion inside the
 * mobile filter sheet) and needed by every mobile page that strips the desktop
 * container chrome.
 *
 * Loaded by: index.php (instead of mobile.css) and by every page that loads
 * mobile.css. Keep it here — do NOT copy these rules back into mobile.css.
 */

/* ═══ Generic mobile page resets (were inside mobile.css's max-width block) ═══ */
@media (max-width: 900px) {
    /* Strip container/main wrappers so the mobile layout is full-viewport */
    body { margin: 0; padding: 0; }
    body > .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SPECIALTY GROUP ACCORDION — Mobile filter bottom sheet
   ═══════════════════════════════════════════════════════════════ */

.m-sg-filter-accordion {
    display: flex;
    flex-direction: column;
}

.m-sg-filter-group {
    position: relative;
    border-bottom: 1px solid var(--m-border, #E5E5EA);
}
.m-sg-filter-group:last-child {
    border-bottom: none;
}

.m-sg-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.15s;
    min-height: 44px;
}
.m-sg-filter-dot { display: none; }
/* Icon — unified green theme, matches .therapist-view-sec-icon / .sec-ico design */
.m-sg-filter-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--m-primary-soft, #EAF5EC);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--m-primary, #1B5E3B);
    transition: background 0.15s ease, color 0.15s ease;
}
.m-sg-filter-icon svg {
    stroke: currentColor;
}
.m-sg-filter-group.is-open .m-sg-filter-icon {
    background: var(--m-primary, #1B5E3B);
    color: var(--m-btn-color, #fff);
}
.m-sg-filter-group.is-open .m-sg-filter-icon svg {
    stroke: currentColor;
}
.m-sg-filter-header:active {
    background: var(--m-bg, #F2F2F7);
}

.m-sg-filter-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--m-text-sec, #636366);
    line-height: 1.3;
}
.m-sg-filter-group.is-open .m-sg-filter-title {
    color: var(--m-text, #1C1C1E);
    font-weight: 600;
}

/* Count badge -- green pill, hidden until active, pop animation */
.m-sg-filter-count {
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--m-primary, #1B5E3B);
    color: #fff;
    padding: 2px 7px;
    flex-shrink: 0;
}
.m-sg-filter-count.has-active {
    display: inline-flex;
    animation: m-sg-count-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes m-sg-count-pop {
    0%   { transform: scale(0.7); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.m-sg-filter-chevron {
    display: flex;
    align-items: center;
    font-size: 10px;
    color: var(--m-text-muted, #AEAEB2);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s ease;
}
.m-sg-filter-group.is-open .m-sg-filter-chevron {
    transform: rotate(180deg);
    color: var(--m-text-sec, #636366);
}

/* Body -- grid-rows for smooth height animation */
.m-sg-filter-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}
.m-sg-filter-group.is-open .m-sg-filter-body {
    grid-template-rows: 1fr;
}
.m-sg-filter-body > .idx-m-sheet-chips {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 12px;
    transition: padding 0.28s ease;
}
.m-sg-filter-group.is-open .m-sg-filter-body > .idx-m-sheet-chips {
    padding: 2px 12px 14px;
}

/* Chip overrides inside accordion -- clean pill style */
.m-sg-filter-body .idx-m-sheet-chip {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12.5px;
}
.m-sg-filter-body .idx-m-sheet-chip.on {
    background: var(--m-primary, #1B5E3B);
    color: #fff;
    border-color: var(--m-primary, #1B5E3B);
}
/* ═══════════════════════════════════════════════════════════════
   SPECIALTY GROUP — Dark Pro theme overrides
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .m-sg-group.is-open[data-group="clinical"] .m-sg-header,
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="clinical"] .m-sg-header     { background: rgba(37,99,235,0.08); }
[data-theme="dark"] .m-sg-group.is-open[data-group="counseling"] .m-sg-header,
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="counseling"] .m-sg-header   { background: rgba(5,150,105,0.08); }
[data-theme="dark"] .m-sg-group.is-open[data-group="child"] .m-sg-header,
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="child"] .m-sg-header         { background: rgba(217,119,6,0.08); }
[data-theme="dark"] .m-sg-group.is-open[data-group="addiction"] .m-sg-header,
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="addiction"] .m-sg-header     { background: rgba(220,38,38,0.08); }

[data-theme="dark"] .m-sg-group.is-open[data-group="clinical"],
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="clinical"]     { border-left-color: #60A5FA; }
[data-theme="dark"] .m-sg-group.is-open[data-group="counseling"],
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="counseling"]   { border-left-color: #34D399; }
[data-theme="dark"] .m-sg-group.is-open[data-group="child"],
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="child"]         { border-left-color: #FBBF24; }
[data-theme="dark"] .m-sg-group.is-open[data-group="addiction"],
[data-mobile-theme="dark"] .m-sg-group.is-open[data-group="addiction"]     { border-left-color: #F87171; }

[data-theme="dark"] .m-sg-filter-count,
[data-mobile-theme="dark"] .m-sg-filter-count { background: #34D399; color: #1C1C1E; }
[data-theme="dark"] .m-sg-filter-title,
[data-mobile-theme="dark"] .m-sg-filter-title { color: rgba(255,255,255,0.6); }
[data-theme="dark"] .m-sg-filter-group.is-open .m-sg-filter-title,
[data-mobile-theme="dark"] .m-sg-filter-group.is-open .m-sg-filter-title { color: #F5F5F5; }
[data-theme="dark"] .m-sg-filter-group,
[data-mobile-theme="dark"] .m-sg-filter-group { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .m-sg-filter-header:active,
[data-mobile-theme="dark"] .m-sg-filter-header:active { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .m-sg-filter-body .idx-m-sheet-chip.on,
[data-mobile-theme="dark"] .m-sg-filter-body .idx-m-sheet-chip.on { background: #34D399; color: #1C1C1E; border-color: #34D399; }

/* ═══════════════════════════════════════════════════════════════
   SPECIALTY GROUP — Warm Sand theme overrides
   ═══════════════════════════════════════════════════════════════ */

[data-theme="warm"] .m-sg-group.is-open[data-group="clinical"] .m-sg-header,
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="clinical"] .m-sg-header     { background: #EDE9FE; }
[data-theme="warm"] .m-sg-group.is-open[data-group="counseling"] .m-sg-header,
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="counseling"] .m-sg-header   { background: #F3EDE4; }
[data-theme="warm"] .m-sg-group.is-open[data-group="child"] .m-sg-header,
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="child"] .m-sg-header         { background: #FDF0E2; }
[data-theme="warm"] .m-sg-group.is-open[data-group="addiction"] .m-sg-header,
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="addiction"] .m-sg-header     { background: #FBEAE8; }

[data-theme="warm"] .m-sg-group.is-open[data-group="clinical"],
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="clinical"]     { border-left-color: #6D28D9; }
[data-theme="warm"] .m-sg-group.is-open[data-group="counseling"],
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="counseling"]   { border-left-color: #5D4E37; }
[data-theme="warm"] .m-sg-group.is-open[data-group="child"],
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="child"]         { border-left-color: #C67A3C; }
[data-theme="warm"] .m-sg-group.is-open[data-group="addiction"],
[data-mobile-theme="warm"] .m-sg-group.is-open[data-group="addiction"]     { border-left-color: #C44D3E; }

[data-theme="warm"] .m-sg-filter-count,
[data-mobile-theme="warm"] .m-sg-filter-count { background: #5D4E37; color: #FFF; }
[data-theme="warm"] .m-sg-filter-title,
[data-mobile-theme="warm"] .m-sg-filter-title { color: #8B7E6A; }
[data-theme="warm"] .m-sg-filter-group.is-open .m-sg-filter-title,
[data-mobile-theme="warm"] .m-sg-filter-group.is-open .m-sg-filter-title { color: #3D3425; }
[data-theme="warm"] .m-sg-filter-group,
[data-mobile-theme="warm"] .m-sg-filter-group { border-bottom-color: #E5DDD0; }
[data-theme="warm"] .m-sg-filter-header:active,
[data-mobile-theme="warm"] .m-sg-filter-header:active { background: #F3EDE4; }
[data-theme="warm"] .m-sg-filter-body .idx-m-sheet-chip.on,
[data-mobile-theme="warm"] .m-sg-filter-body .idx-m-sheet-chip.on { background: #5D4E37; color: #FFF; border-color: #5D4E37; }
