/*--------------------------------------------------------------
# Shared Thread Pages
--------------------------------------------------------------*/

.thread-page {
    background: #f8fafc;
}

.thread-page-section {
    padding: 70px 0;
}

.thread-shell {
    display: block;
}


/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/

.thread-page,
.thread-page h1,
.thread-page h2,
.thread-page h3,
.thread-page h4,
.thread-page h5,
.thread-page p,
.thread-page a,
.thread-page button,
.thread-page input,
.thread-page select,
.thread-page .section-title h2,
.thread-page .section-title p {
    font-family: "Poppins", "Roboto", sans-serif;
}


/*--------------------------------------------------------------
# Internal Header
--------------------------------------------------------------*/

.thread-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.thread-page-header-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.thread-page-header-copy p {
    margin: 0;
    max-width: 860px;
    color: var(--default-color);
    font-size: 0.95rem;
    line-height: 1.75;
}

.thread-page-header-side {
    flex: 0 0 auto;
}

.thread-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 14px;
    margin-bottom: 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.thread-page-badge.is-public {
    background: rgba(80, 197, 255, 0.12);
    border-color: rgba(80, 197, 255, 0.18);
    color: #1d4f6b;
}

.thread-page-badge.is-private {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.thread-page-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.thread-page-user-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(80, 197, 255, 0.12);
    color: var(--accent-color);
    font-size: 1.15rem;
}

.thread-page-user strong {
    display: block;
    margin-bottom: 3px;
    color: var(--heading-color);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.3;
}

.thread-page-user span {
    display: block;
    color: var(--default-color);
    font-size: 0.88rem;
    line-height: 1.45;
}


/*--------------------------------------------------------------
# Shared Panel
--------------------------------------------------------------*/

.thread-panel {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    padding: 28px;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.thread-panel::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(80, 197, 255, 0.10), transparent 70%);
    pointer-events: none;
}

.thread-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.10);
    border-color: rgba(80, 197, 255, 0.20);
}


/*--------------------------------------------------------------
# Panel Head
--------------------------------------------------------------*/

.thread-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.thread-panel-head-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(80, 197, 255, 0.12);
    color: var(--accent-color);
    font-size: 1.15rem;
}

.thread-panel-head-content {
    flex: 1;
    min-width: 0;
}

.thread-panel-head-content h3 {
    margin: 0 0 14px;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--heading-color);
}

.thread-panel-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thread-panel-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--default-color);
    word-break: break-word;
}

.thread-panel-meta-label {
    color: var(--default-color);
    font-weight: 500;
}

.thread-panel-meta-line strong {
    color: var(--heading-color);
    font-weight: 700;
}


/*--------------------------------------------------------------
# Toolbar
--------------------------------------------------------------*/

.thread-toolbar {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--surface-muted);
    position: relative;
    z-index: 2;
}

.thread-input-wrap {
    min-height: 50px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #ffffff;
    transition: 0.25s ease;
}

.thread-input-wrap i {
    width: 46px;
    flex: 0 0 46px;
    text-align: center;
    color: #98a2b3;
    font-size: 0.95rem;
}

.thread-input,
.thread-select {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--heading-color);
    font-size: 0.95rem;
}

.thread-input {
    padding: 0 14px 0 0;
}

.thread-select {
    padding: 0 14px 0 0;
    appearance: none;
    cursor: pointer;
}

.thread-input-wrap:focus-within {
    border-color: rgba(80, 197, 255, 0.65);
    box-shadow: 0 0 0 4px rgba(80, 197, 255, 0.10);
}


/*--------------------------------------------------------------
# Notes
--------------------------------------------------------------*/

.thread-note {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(80, 197, 255, 0.08);
    border: 1px solid rgba(80, 197, 255, 0.12);
    color: var(--heading-color);
    font-size: 0.92rem;
    line-height: 1.7;
    position: relative;
    z-index: 2;
}


/*--------------------------------------------------------------
# Shared Buttons
--------------------------------------------------------------*/

.thread-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.25s ease;
    text-align: center;
}

.thread-btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
    box-shadow: 0 10px 24px rgba(80, 197, 255, 0.18);
}

.thread-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--contrast-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.thread-btn-light {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--heading-color);
}

.thread-btn-light:hover {
    background: var(--surface-muted);
    border-color: rgba(80, 197, 255, 0.20);
    color: var(--heading-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.thread-btn-dark {
    background: #414042;
    border-color: #414042;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(65, 64, 66, 0.18);
}

.thread-btn-dark:hover {
    background: #2e2d2f;
    border-color: #2e2d2f;
    color: #ffffff;
    transform: translateY(-1px);
    text-decoration: none;
}


/*--------------------------------------------------------------
# Formal Thread List
--------------------------------------------------------------*/

.thread-list-wrap {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.thread-list-grid {
    display: block;
}

.thread-list-grid .q-item:last-child .thread-list-row {
    border-bottom: none;
}

.thread-list-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.thread-list-row:hover {
    background: #f9fcff;
}

.thread-list-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(80, 197, 255, 0.14), rgba(80, 197, 255, 0.26));
    color: #168dca;
    font-size: 1.55rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.thread-list-content {
    flex: 1;
    min-width: 0;
}

.thread-list-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.thread-list-user-block {
    min-width: 0;
}

.thread-list-name {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    word-break: break-word;
}

.thread-list-time {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

.thread-list-status {
    flex-shrink: 0;
}

.thread-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.thread-status-badge.is-public {
    background: rgba(80, 197, 255, 0.12);
    border-color: rgba(80, 197, 255, 0.24);
    color: #0f6fa0;
}

.thread-status-badge.is-private {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.16);
    color: #0f172a;
}

.thread-list-body {
    min-width: 0;
}

.thread-list-label {
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.thread-list-preview {
    font-size: 0.94rem;
    line-height: 1.6;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.thread-list-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 130px;
}

.thread-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid #0f172a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.thread-open-btn:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.thread-open-btn:focus {
    outline: none;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(80, 197, 255, 0.2);
}


/*--------------------------------------------------------------
# Actions
--------------------------------------------------------------*/

.thread-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.thread-actions-bottom {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}


/*--------------------------------------------------------------
# Empty States
--------------------------------------------------------------*/

.thread-empty {
    padding: 36px 22px;
    border-radius: 22px;
    border: 1px dashed var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.thread-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(80, 197, 255, 0.12);
    color: var(--accent-color);
    font-size: 1.35rem;
}

.thread-empty h5 {
    margin: 0 0 10px;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--heading-color);
}

.thread-empty p {
    margin: 0;
    color: var(--default-color);
    line-height: 1.7;
    font-size: 0.95rem;
}

.thread-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
}


/*--------------------------------------------------------------
# Large Screens
--------------------------------------------------------------*/

@media (min-width: 1200px) {
    .thread-panel {
        padding: 32px;
    }
}


/*--------------------------------------------------------------
# Tablet
--------------------------------------------------------------*/

@media (max-width: 1199.98px) {
    .thread-page-header-copy p {
        font-size: 0.94rem;
    }
}

@media (max-width: 991.98px) {
    .thread-page-section {
        padding: 60px 0;
    }

    .thread-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .thread-page-header-side,
    .thread-page-user {
        width: 100%;
    }

    .thread-panel {
        padding: 24px;
        border-radius: 20px;
    }

    .thread-panel-head-content h3 {
        font-size: 1.15rem;
    }

    .thread-list-row {
        gap: 14px;
        padding: 16px;
    }

    .thread-list-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.4rem;
    }

    .thread-list-action {
        min-width: 118px;
    }

    .thread-open-btn {
        min-height: 40px;
        padding: 9px 14px;
        font-size: 0.88rem;
    }
}


/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/

@media (max-width: 767.98px) {
    .thread-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .thread-panel-head {
        flex-direction: column;
        gap: 12px;
    }

    .thread-panel-head-icon {
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
        border-radius: 14px;
        font-size: 1.05rem;
    }

    .thread-panel-head-content h3 {
        font-size: 1.08rem;
        margin-bottom: 10px;
    }

    .thread-panel-meta {
        gap: 6px;
    }

    .thread-toolbar {
        padding: 14px;
        border-radius: 16px;
    }

    .thread-actions,
    .thread-empty-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .thread-btn {
        width: 100%;
        min-height: 48px;
    }

    .thread-empty {
        padding: 28px 16px;
        border-radius: 18px;
    }

    .thread-list-row {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .thread-list-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
        font-size: 1.28rem;
    }

    .thread-list-content {
        min-width: 0;
        flex: 1 1 calc(100% - 56px);
    }

    .thread-list-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
    }

    .thread-list-status {
        width: 100%;
    }

    .thread-status-badge {
        white-space: normal;
    }

    .thread-list-action {
        width: 100%;
        min-width: 100%;
        padding-left: 56px;
        justify-content: flex-start;
    }

    .thread-open-btn {
        width: 100%;
        min-height: 42px;
    }

    .thread-list-preview {
        -webkit-line-clamp: 3;
    }
}


/*--------------------------------------------------------------
# Small Phones
--------------------------------------------------------------*/

@media (max-width: 575.98px) {
    .thread-page-section {
        padding: 55px 0;
    }

    .thread-page-badge {
        min-height: 32px;
        font-size: 0.72rem;
        padding: 6px 11px;
        gap: 6px;
    }

    .thread-note,
    .thread-list-preview,
    .thread-empty p,
    .thread-panel-meta-line {
        font-size: 0.92rem;
    }

    .thread-input-wrap i {
        width: 42px;
        flex: 0 0 42px;
        font-size: 0.9rem;
    }

    .thread-input,
    .thread-select {
        font-size: 0.92rem;
    }

    .thread-list-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 12px;
    }

    .thread-list-name {
        font-size: 0.96rem;
    }
}


/*--------------------------------------------------------------
# Very Small Phones
--------------------------------------------------------------*/

@media (max-width: 420px) {
    .thread-panel {
        padding: 16px;
    }

    .thread-toolbar {
        padding: 12px;
    }

    .thread-btn {
        min-height: 44px;
        padding: 0 14px;
        font-size: 0.9rem;
    }

    .thread-empty {
        padding: 24px 14px;
    }

    .thread-list-row {
        padding: 12px;
    }

    .thread-list-name {
        font-size: 0.95rem;
    }

    .thread-list-time {
        font-size: 0.76rem;
    }

    .thread-list-preview {
        font-size: 0.88rem;
    }

    .thread-list-action {
        padding-left: 0;
    }
}