/**
 * BodhaHub - Frontend Stylesheet
 * 
 * Supports Timeline, Accordion, Grid, and Minimalist templates with Dark and Light mode presets.
 * 
 * @package BodhaHub
 * @author  Bimlesh Changia (Changia Solutions LLP)
 * @version 1.02
 */

:root {
    --bh-accent: #6366f1;
    --bh-accent-hover: #4f46e5;
    --bh-accent-glow: rgba(99, 102, 241, 0.25);
    --bh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   CONTAINER BASE & RESETS
   ========================================================================== */
.bodhahub-changelog-container {
    font-family: var(--bh-font);
    width: 100%;
    max-width: var(--bh-container-max-width, 100%);
    margin: 0 auto;
    border-radius: 20px;
    padding: 28px;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    line-height: 1.5;
}

.bodhahub-changelog-container *,
.bodhahub-changelog-container *::before,
.bodhahub-changelog-container *::after {
    box-sizing: border-box;
}

.bodhahub-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   THEME: BODHA SLATE (DARK MODE)
   ========================================================================== */
.bodhahub-theme-dark {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #1e293b;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.bodhahub-theme-dark .bodhahub-header-bar {
    border-bottom: 1px solid #1e293b;
}

.bodhahub-theme-dark .bodhahub-project-select {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}

.bodhahub-theme-dark .bodhahub-search-box input {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}

.bodhahub-theme-dark .bodhahub-pill {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.bodhahub-theme-dark .bodhahub-pill:hover,
.bodhahub-theme-dark .bodhahub-pill.active {
    background: var(--bh-accent);
    color: #ffffff;
    border-color: var(--bh-accent);
    box-shadow: 0 0 16px var(--bh-accent-glow);
}

.bodhahub-theme-dark .bodhahub-release-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}

.bodhahub-theme-dark .bodhahub-timeline-track::before {
    background: linear-gradient(180deg, var(--bh-accent) 0%, #334155 100%);
}

.bodhahub-theme-dark .bodhahub-card-summary {
    color: #cbd5e1;
}

.bodhahub-theme-dark .bodhahub-item-row {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
}

.bodhahub-theme-dark .bodhahub-release-date {
    color: #94a3b8;
}

.bodhahub-theme-dark .bodhahub-accordion-item {
    background: #1e293b;
    border: 1px solid #334155;
}

.bodhahub-theme-dark .bodhahub-accordion-header {
    background: #1e293b;
    color: #f8fafc;
}

.bodhahub-theme-dark .bodhahub-accordion-header:hover {
    background: #243248;
}

.bodhahub-theme-dark .bodhahub-accordion-content {
    border-top: 1px solid #334155;
}

.bodhahub-theme-dark .bodhahub-footer-bar {
    border-top: 1px solid #1e293b;
    color: #64748b;
}

.bodhahub-theme-dark .bodhahub-footer-link {
    color: #94a3b8;
}

/* ==========================================================================
   THEME: CLEAN CRISP (LIGHT MODE)
   ========================================================================== */
.bodhahub-theme-light {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
}

.bodhahub-theme-light .bodhahub-header-bar {
    border-bottom: 1px solid #e2e8f0;
}

.bodhahub-theme-light .bodhahub-project-select {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.bodhahub-theme-light .bodhahub-search-box input {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.bodhahub-theme-light .bodhahub-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.bodhahub-theme-light .bodhahub-pill:hover,
.bodhahub-theme-light .bodhahub-pill.active {
    background: var(--bh-accent);
    color: #ffffff;
    border-color: var(--bh-accent);
    box-shadow: 0 4px 14px var(--bh-accent-glow);
}

.bodhahub-theme-light .bodhahub-release-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.bodhahub-theme-light .bodhahub-timeline-track::before {
    background: linear-gradient(180deg, var(--bh-accent) 0%, #e2e8f0 100%);
}

.bodhahub-theme-light .bodhahub-card-summary {
    color: #475569;
}

.bodhahub-theme-light .bodhahub-item-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.bodhahub-theme-light .bodhahub-release-date {
    color: #64748b;
}

.bodhahub-theme-light .bodhahub-accordion-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.bodhahub-theme-light .bodhahub-accordion-header {
    background: #ffffff;
    color: #0f172a;
}

.bodhahub-theme-light .bodhahub-accordion-header:hover {
    background: #f8fafc;
}

.bodhahub-theme-light .bodhahub-accordion-content {
    border-top: 1px solid #e2e8f0;
}

.bodhahub-theme-light .bodhahub-footer-bar {
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
}

.bodhahub-theme-light .bodhahub-footer-link {
    color: #64748b;
}

/* ==========================================================================
   HEADER BAR, SWITCHER & TOOLBAR
   ========================================================================== */
.bodhahub-header-bar {
    padding-bottom: 22px;
    margin-bottom: 28px;
}

.bodhahub-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.bodhahub-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.bodhahub-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bh-accent);
    box-shadow: 0 0 10px var(--bh-accent);
    display: inline-block;
    animation: bodhahub-pulse 2s infinite;
}

@keyframes bodhahub-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.bodhahub-select-wrapper {
    position: relative;
    display: inline-block;
}

.bodhahub-project-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 36px 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.bodhahub-select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 10px;
    opacity: 0.7;
}

.bodhahub-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.bodhahub-search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}

.bodhahub-search-icon,
svg.bodhahub-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
    stroke: currentColor;
    opacity: 0.5;
    display: inline-block !important;
    pointer-events: none;
}

.bodhahub-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.bodhahub-search-box input:focus {
    border-color: var(--bh-accent);
    box-shadow: 0 0 0 3px var(--bh-accent-glow);
}

.bodhahub-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bodhahub-pill {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

/* ==========================================================================
   CARDS & COMMON RELEASE ELEMENTS
   ========================================================================== */
.bodhahub-release-card {
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.2s;
}

.bodhahub-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.bodhahub-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bodhahub-badge-version {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    background: var(--bh-accent);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px var(--bh-accent-glow);
}

.bodhahub-badge-latest {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
}

.bodhahub-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.bodhahub-release-date {
    font-size: 12px;
    font-weight: 500;
}

.bodhahub-card-summary {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.bodhahub-card-summary p {
    margin: 0 0 8px 0;
}

.bodhahub-card-summary p:last-child {
    margin-bottom: 0;
}

.bodhahub-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bodhahub-item-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    transition: all 0.15s;
}

.bodhahub-item-desc {
    flex: 1;
}

.bodhahub-ticket-ref {
    display: inline-block;
    font-family: monospace;
    font-size: 11px;
    opacity: 0.6;
    margin-left: 6px;
}

/* ==========================================================================
   TAG PILLS & BADGES
   ========================================================================== */
.bodhahub-item-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 6px;
    shrink: 0;
    white-space: nowrap;
    margin-top: 1px;
}

.bodhahub-tag-new {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.bodhahub-tag-feature {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.bodhahub-tag-fix {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.bodhahub-tag-security {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.bodhahub-tag-improvement {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ==========================================================================
   TEMPLATE 1: TIMELINE
   ========================================================================== */
.bodhahub-view-timeline .bodhahub-timeline-track {
    position: relative;
    padding-left: 36px;
}

.bodhahub-view-timeline .bodhahub-timeline-track::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 15px;
    bottom: 20px;
    width: 2px;
    border-radius: 2px;
}

.bodhahub-timeline-node {
    position: relative;
}

.bodhahub-timeline-marker {
    position: absolute;
    left: -36px;
    top: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bodhahub-marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bh-accent);
    z-index: 2;
    transition: all 0.2s;
}

.bodhahub-timeline-node.is-latest .bodhahub-marker-dot {
    box-shadow: 0 0 12px var(--bh-accent);
    transform: scale(1.2);
}

/* ==========================================================================
   TEMPLATE 2: ACCORDION
   ========================================================================== */
.bodhahub-accordion-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

.bodhahub-btn-text {
    background: none;
    border: none;
    color: var(--bh-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.bodhahub-btn-text:hover {
    text-decoration: underline;
}

.bodhahub-accordion-item {
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.bodhahub-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    outline: none;
    transition: all 0.15s;
}

.bodhahub-accordion-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bodhahub-accordion-title {
    font-size: 15px;
    font-weight: 700;
}

.bodhahub-accordion-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bodhahub-accordion-chevron {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.bodhahub-accordion-item.is-open .bodhahub-accordion-chevron {
    transform: rotate(90deg);
}

.bodhahub-accordion-content {
    padding: 20px;
}

/* ==========================================================================
   TEMPLATE 3: GRID
   ========================================================================== */
.bodhahub-grid-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
}

.bodhahub-grid-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ==========================================================================
   TEMPLATE 4: MINIMAL
   ========================================================================== */
.bodhahub-minimal-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bodhahub-minimal-entry {
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.bodhahub-minimal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.bodhahub-minimal-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.bodhahub-minimal-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bodhahub-tag-inline {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   FOOTER BAR & EMPTY STATE
   ========================================================================== */
.bodhahub-footer-bar {
    margin-top: 32px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 11px;
}

.bodhahub-footer-link {
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.bodhahub-footer-link:hover {
    text-decoration: underline;
}

.bodhahub-empty-state {
    text-align: center;
    padding: 48px 16px;
    opacity: 0.7;
}

.bodhahub-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 640px) {
    .bodhahub-changelog-container {
        padding: 18px;
        margin: 16px auto;
    }

    .bodhahub-header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .bodhahub-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .bodhahub-search-box {
        max-width: 100%;
    }

    .bodhahub-view-timeline .bodhahub-timeline-track {
        padding-left: 24px;
    }

    .bodhahub-timeline-marker {
        left: -24px;
    }

    .bodhahub-grid-wrap {
        grid-template-columns: 1fr;
    }
}
