/* Test info (detail) page — redesigned to match the Figma "about test" screen:
   a white rounded content card holding a coloured hero (title + meta inside the
   banner), a primary action row, a two-column description/info grid, the
   author's other tests and the comments. */

.ti-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px 24px 12px;
}

/* ---------- Breadcrumbs ---------- */
.ti-breadcrumbs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Content wrapper (no background / shadow) ---------- */
.ti-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    background: transparent;
}

/* ---------- Hero banner ---------- */
.ti-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 20px;
    color: #FFFFFF;
    background: var(--green-color);
    min-height: 112px;
    box-sizing: border-box;
}

.ti-hero__bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ti-hero__actions {
    display: inline-flex;
    flex-direction: row;
    gap: 8px;
}

.ti-hero__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .55);
    background: transparent;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0;
    transition: background-color .15s ease, transform .1s ease;
}

    .ti-hero__icon:hover:not(:disabled) {
        background: rgba(255, 255, 255, .18);
    }

    .ti-hero__icon:active:not(:disabled) {
        transform: scale(.94);
    }

    .ti-hero__icon:disabled {
        cursor: default;
        opacity: .55;
    }

.ti-hero__icon--filled {
    border-color: transparent;
    background: rgba(255, 255, 255, .18);
}

.ti-hero__icon--liked {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: var(--red-color);
}

    .ti-hero__icon--liked:hover:not(:disabled) {
        background: #FFFFFF;
    }

.ti-hero__title {
    font-family: var(--third-family);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.25;
    color: #FFFFFF;
    margin: 0;
    word-break: break-word;
}

.ti-hero__meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.ti-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
}

.ti-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.ti-chip--solid {
    background: #FFFFFF;
    color: var(--text-dark-color);
}

/* ---------- Action row ---------- */
.ti-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ti-pass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--blue-color);
    color: #FFFFFF;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
}

    .ti-pass:hover {
        filter: brightness(1.05);
    }

    .ti-pass:active {
        transform: scale(.98);
    }

/* Compact report / result plate (right column) */
.ti-entry {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: filter .15s ease, transform .1s ease;
}

    .ti-entry:hover {
        filter: brightness(1.03);
    }

    .ti-entry:active {
        transform: scale(.99);
    }

.ti-entry--stats {
    background: var(--red-color);
    color: #FFFFFF;
}

.ti-entry--result {
    background: #FFFFFF;
    color: var(--text-dark-color);
    border: 1px solid rgba(135, 148, 168, .18);
}

.ti-entry__text {
    flex: 1 1 auto;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.ti-entry__go {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F0F0F6;
    color: var(--red-color);
}

.ti-entry--result .ti-entry__go {
    background: var(--gray-200);
    color: var(--text-gray-dark);
}

/* ---------- Two-column grid ---------- */
.ti-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.ti-grid__main,
.ti-grid__side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* ---------- Sections ---------- */
.ti-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ti-section__heading-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.ti-section__heading-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

.ti-section__heading {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 28px;
    color: var(--text-dark-color);
    margin: 0;
}

.ti-section__chevron {
    display: inline-flex;
    align-items: center;
    color: var(--text-gray-color);
}

.ti-section__paragraph {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-gray-dark);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.ti-section__note {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-gray-color);
    margin: 0;
}

.ti-link-button {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 4px 0;
    margin: 0;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    color: var(--blue-color);
    cursor: pointer;
}

    .ti-link-button:hover {
        color: var(--blue-700);
    }

/* ---------- Info panel (questions) ---------- */
.ti-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid rgba(135, 148, 168, .18);
    border-radius: 16px;
}

.ti-info__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ti-info__label {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-gray-dark);
}

.ti-info__value {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark-color);
}

.ti-questions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: var(--green-color);
    color: #FFFFFF;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: filter .15s ease;
}

    .ti-questions-btn:hover {
        filter: brightness(1.05);
    }

/* ---------- Author card ---------- */
.ti-author {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid rgba(135, 148, 168, .18);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background-color .15s ease;
}

    .ti-author:hover {
        background: var(--gray-200);
    }

.ti-author__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.ti-author__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.ti-author__label {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 13px;
    color: var(--text-gray-color);
}

.ti-author__name {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ti-author__chevron {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: var(--gray-500);
}

/* ---------- Horizontal scroller (other tests carousel) ---------- */
.ti-horizontal-scroller {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .ti-horizontal-scroller::-webkit-scrollbar {
        display: none;
    }

    .ti-horizontal-scroller > * {
        scroll-snap-align: start;
    }

/* ---------- Comments ---------- */
.ti-comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ti-comment {
    background: #FFFFFF;
    border: 1px solid rgba(135, 148, 168, .18);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ti-comment__top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.ti-comment__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.ti-comment__name {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-gray-dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ti-comment__date {
    flex: 0 0 auto;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-500);
}

.ti-comment__text {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-dark-color);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Panels (error / empty states) ---------- */
.ti-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 24px;
    text-align: center;
    border-radius: 20px;
    background: #FFFFFF;
}

.ti-panel--error {
    background: var(--gray-200);
}

.ti-panel__title {
    font-family: var(--third-family);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark-color);
    margin: 0;
}

.ti-panel__sub {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
    max-width: 420px;
}

/* ---------- Skeletons ---------- */
.ti-skeleton {
    background: rgba(255, 255, 255, .35);
    border-radius: 10px;
    animation: ti-skeleton-pulse 1.2s ease-in-out infinite;
}

.ti-card .ti-grid .ti-skeleton,
.ti-card .ti-actions .ti-skeleton,
.ti-card .ti-section .ti-skeleton {
    background: var(--gray-300);
}

.ti-skeleton--chip {
    width: 96px;
    height: 22px;
}

.ti-skeleton--title {
    width: min(80%, 360px);
    height: 30px;
}

.ti-skeleton--heading {
    width: 180px;
    height: 22px;
}

.ti-skeleton--paragraph {
    width: 100%;
    height: 56px;
}

.ti-skeleton--pass {
    width: 192px;
    height: 48px;
    border-radius: 12px;
}

@keyframes ti-skeleton-pulse {
    0%, 100% { opacity: .85; }
    50% { opacity: .55; }
}

/* ---------- "Leave a comment" button + modal ---------- */
.ti-section__heading-row--between {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ti-comment-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: var(--blue-color);
    color: #FFFFFF;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
}

    .ti-comment-add:hover {
        filter: brightness(1.05);
    }

    .ti-comment-add:active {
        transform: scale(.98);
    }

.ti-cm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(22, 30, 57, .45);
    animation: ti-cm-fade .15s ease;
}

.ti-cm-dialog {
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 12px 40px rgba(22, 30, 57, .2);
}

.ti-cm-dialog__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ti-cm-dialog__title {
    margin: 0;
    font-family: var(--third-family);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark-color);
}

.ti-cm-dialog__close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--gray-200);
    color: var(--text-gray-dark-color);
    cursor: pointer;
}

    .ti-cm-dialog__close:hover {
        background: var(--gray-300);
    }

.ti-cm-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-dark-color);
    background: var(--gray-200);
    outline: none;
    transition: border-color .15s ease, background-color .15s ease;
}

    .ti-cm-textarea:focus {
        border-color: var(--blue-color);
        background: #FFFFFF;
    }

.ti-cm-dialog__foot {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ti-cm-count {
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-gray-color);
}

.ti-cm-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    background: var(--blue-color);
    color: #FFFFFF;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: filter .15s ease;
}

    .ti-cm-submit:hover:not(:disabled) {
        filter: brightness(1.05);
    }

    .ti-cm-submit:disabled {
        opacity: .5;
        cursor: default;
    }

@keyframes ti-cm-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Tablet and up ---------- */
@media (min-width: 768px) {

    .ti-root {
        gap: 20px;
        padding: 0 8px 24px 8px;
        height: 100%;
        max-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
    }

        .ti-root::-webkit-scrollbar { width: 6px; }
        .ti-root::-webkit-scrollbar-thumb {
            background-color: rgba(135, 148, 168, .35);
            border-radius: 6px;
        }

    .ti-card {
        gap: 28px;
    }

    .ti-hero {
        padding: 24px;
        min-height: 120px;
    }

    .ti-hero__icon {
        width: 48px;
        height: 48px;
    }

    .ti-hero__title {
        font-size: 24px;
    }

    /* The pass button sizes to its content rather than stretching full width. */
    .ti-pass {
        align-self: flex-start;
        min-width: 192px;
    }
}

/* ---------- Desktop and wider ---------- */
@media (min-width: 1024px) {

    /* Description on the left, info/author on the right, matching the design. */
    .ti-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 32px;
        align-items: start;
    }
}
