/**
 * Release Hub Block Styles
 */

:root {
    --cha-hub-bg: #FBFCFD;
    --cha-hub-bg-light: #f8f9fa;
    --cha-hub-text: #1a1a1a;
    --cha-hub-text-muted: #666666;
    --cha-hub-border: rgba(222, 225, 234, .6);
}

/* Hub Container */
.cha-release-hub {
    color: var(--cha-hub-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 400px;
}

/* Tabs Header */
.cha-hub-tabs {
    display: flex;
    gap: 0;
    padding: 20px 0 0 0;
    background: transparent;
}

.cha-hub-tab {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1px;
    box-shadow: none;
    padding: 11px 20px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--cha-hub-border);
    border-radius:0;
    color: var(--cha-hub-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    transition: color 0.2s ease;
}

.cha-hub-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cha-hub-tab:hover {
    color: var(--cha-hub-text);
    background-color: transparent;
    box-shadow: none;
    border-color:var(--cha-hub-border);
}

.cha-hub-tab.active {
    color: var(--changeloger_brand_color);
    border-color:var(--changeloger_brand_color);
    font-weight: 600;
    background-color: #fff;
    box-shadow: none;
}
.cha-hub-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #fff;
}


.cha-hub-tab .coming-soon {
    font-size: 10px;
    font-weight: 500;
    background: var(--cha-hub-bg-light);
    color: var(--cha-hub-text-muted);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tab Content */
.cha-hub-content {
    padding: 0;
}

.cha-hub-panel {
    display: none;
    background-color: #fff;
}

.cha-hub-panel.active {
    display: block;
}

/* Coming Soon Panel */
.cha-coming-soon-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 40px;
    text-align: center;
    background: var(--cha-hub-bg-light);
}

.cha-coming-soon-panel svg {
    width: 56px;
    height: 56px;
    color: var(--changeloger_brand_color);
    margin-bottom: 24px;
    opacity: 0.6;
}

.cha-coming-soon-panel h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--cha-hub-text);
    margin: 0 0 8px 0;
}

.cha-coming-soon-panel p {
    font-size: 15px;
    color: var(--cha-hub-text-muted);
    margin: 0;
    max-width: 360px;
}

/* Editor Preview */
.cha-release-hub-editor {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.cha-hub-preview {
    text-align: center;
}

.cha-hub-tabs-preview {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
}

.cha-hub-tabs-preview span {
    color: #888;
    font-size: 14px;
    padding-bottom: 14px;
}

.cha-hub-tabs-preview span.active {
    color: #525df9;
    font-weight: 600;
    border-bottom: 3px solid #525df9;
    margin-bottom: -17px;
}

.cha-hub-content-preview p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.cha-hub-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #525df9;
}

/* Responsive */
@media (max-width: 768px) {
    .cha-hub-tabs {
        padding: 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cha-hub-tab {
        padding: 16px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .cha-coming-soon-panel {
        padding: 60px 24px;
    }
}

/* Badge Filter Pills */
.cha-badge-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 40px;
    padding-top: 50px;
    background: #fff;
    justify-content: center;
}

.cha-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s;
}

.cha-badge-pill:hover {
    color: var(--badge-color, --changeloger_brand_color);    
    background:  color-mix(in srgb, var(--badge-color) 10%, transparent);
    border: 1px solid  color-mix(in srgb, var(--badge-color) 20%, transparent);
}

.cha-badge-pill.active {
    background:  var(--badge-color);
    border-color:var(--badge-color);
    color:#fff;
    font-weight: 600;
}

/* "All" pill uses default accent */
.cha-badge-pill[data-badge=""] {
    --badge-color: var(--changeloger_brand_color);
}

/* Transition for filtering releases */
.cha-release-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cha-release-item.cha-hidden {
    display: none;
}

/* Responsive badge filter */
@media (max-width: 768px) {
    .cha-badge-filter {
        padding: 16px 20px;
        gap: 8px;
    }

    .cha-badge-pill {
        padding: 5px 11px;
        font-size: 13px;
    }
}

/* Release Search Bar
   Rendered after the cha-subscribe-header (when enabled via the
   "Show Search Bar" block toggle). Searches title, version, release date. */
.cha-release-search {
    display: flex;
    justify-content: center;
    padding: 16px 40px 8px;
    background: #fff;
}

.cha-release-search__label {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
}

.cha-release-search__icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.cha-release-search__input[type="search"] {
    width: 100%;
    padding: 10px 40px 10px 40px;
    font-size: 14px;
    line-height: 1.4;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.cha-release-search__input[type="search"]::placeholder {
    color: #94a3b8;
}

.cha-release-search__input[type="search"]:focus {
    outline: none;
    border-color: var(--changeloger_brand_color, #6366f1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--changeloger_brand_color, #6366f1) 18%, transparent);
}

.cha-release-search__clear {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cha-release-search__clear:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.cha-release-search__submit {
    margin-left: 8px;
    padding: 8px 14px;
    font-size: 14px;
    color: #fff;
    background: var(--changeloger_brand_color, #6366f1);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

/* Loading indicator while AJAX search is in flight */
.cha-changelog-container--loading {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s;
}

.cha-changelog-container--loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--changeloger_brand_color, #6366f1);
    border-radius: 50%;
    animation: cha-search-spin 0.7s linear infinite;
}

@keyframes cha-search-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .cha-release-search {
        padding: 12px 16px 6px;
    }

    .cha-release-search__input[type="search"] {
        padding: 9px 36px 9px 38px;
        font-size: 13px;
    }
}