/* Мои тикеты и лента Discord-транскрипта — разметка: app/templates/tickets/, partials/discord_transcript.html */
/* Breadcrumb стили */
.breadcrumb {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.4);
}

/* Раздел «Мои тикеты» (Discord) */
.ticket-portal-wrap {
    max-width: 920px;
    margin: 0 auto;
}
.ticket-portal-hero {
    position: relative;
    border-radius: 1.25rem;
    padding: 1.6rem 1.5rem;
    margin-bottom: 1.35rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.14) 0%, rgba(12, 14, 20, 0.92) 45%, rgba(0, 123, 255, 0.07) 100%);
    border: 1px solid rgba(0, 123, 255, 0.28);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.ticket-portal-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 55%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(0, 123, 255, 0.12) 0%, transparent 65%);
    pointer-events: none;
}
.ticket-portal-hero-inner {
    position: relative;
    z-index: 1;
}
.ticket-portal-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ticket-portal-title .ticket-portal-icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(0, 123, 255, 0.2);
    color: #7ec8ff;
    font-size: 1.1rem;
}
.ticket-portal-lead {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 36rem;
    margin-bottom: 0;
}
.ticket-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.88);
}
.ticket-user-chip i {
    color: #7289da;
}
.ticket-btn-ghost {
    border-radius: 0.65rem;
    padding: 0.45rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.ticket-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}
.ticket-table-card {
    border-radius: 1rem;
    border: 1px solid rgba(0, 123, 255, 0.18);
    background: rgba(12, 14, 20, 0.88);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}
.ticket-table-card .table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    color: rgba(255, 255, 255, 0.92);
}
.ticket-table-card thead th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.42);
    border-bottom: 1px solid rgba(0, 123, 255, 0.22);
    padding: 0.95rem 1rem;
    background: rgba(0, 123, 255, 0.07);
    white-space: nowrap;
}
.ticket-table-card tbody td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.06);
}
.ticket-table-card tbody tr {
    transition: background 0.15s ease;
}
.ticket-table-card tbody tr:hover {
    background: rgba(0, 123, 255, 0.07);
}
.ticket-id-pill {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(0, 123, 255, 0.14);
    color: #9fd4ff;
}
.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ticket-status-pill--open {
    background: rgba(40, 167, 69, 0.18);
    color: #7dffb3;
    border: 1px solid rgba(40, 167, 69, 0.35);
}
.ticket-status-pill--closed {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.ticket-action-btn {
    border-radius: 0.5rem;
    padding: 0.35rem 0.85rem;
    font-weight: 500;
    font-size: 0.8rem;
}
.ticket-empty {
    padding: 2.75rem 1.5rem;
    text-align: center;
}
.ticket-empty-icon {
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5eb3ff;
    font-size: 1.6rem;
}
.ticket-empty h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.88);
}
.ticket-empty p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}
.ticket-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.ticket-meta-tile {
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.ticket-meta-tile .ticket-meta-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.3rem;
}
.ticket-meta-tile .ticket-meta-value {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
}
.ticket-close-reason {
    border-radius: 1rem;
    border: 1px solid rgba(108, 117, 125, 0.35);
    background: linear-gradient(165deg, rgba(108, 117, 125, 0.12) 0%, rgba(18, 20, 26, 0.75) 100%);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ticket-close-reason .ticket-meta-label {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}
.ticket-close-reason p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.55;
    font-size: 0.92rem;
}
.ticket-transcript-shell {
    border-radius: 1rem;
    border: 1px solid rgba(0, 123, 255, 0.28);
    background: linear-gradient(165deg, rgba(18, 22, 32, 0.98) 0%, rgba(8, 10, 14, 0.99) 100%);
    overflow: hidden;
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 1px 0 rgba(0, 168, 252, 0.12) inset;
}
/* Только шапка блока «Транскрипт», не header у каждого сообщения (.discord-msg-head) */
.ticket-transcript-shell > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 1rem 1.25rem;
    background:
        radial-gradient(ellipse 100% 180% at 0% 0%, rgba(0, 123, 255, 0.18) 0%, transparent 55%),
        linear-gradient(95deg, rgba(0, 123, 255, 0.14) 0%, rgba(0, 80, 140, 0.06) 100%);
    border-bottom: 1px solid rgba(0, 123, 255, 0.22);
}
.ticket-transcript-shell > header span:first-of-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}
.ticket-transcript-shell > header span:first-of-type i {
    font-size: 1rem;
    opacity: 0.95;
    filter: drop-shadow(0 0 8px rgba(0, 168, 252, 0.45));
}
.ticket-transcript-shell > header .ticket-transcript-hint {
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.ticket-transcript-body {
    padding: 0;
    max-height: min(76vh, 680px);
    overflow: auto;
    /* Нейтральный фон без синего свечения — иначе оно проступает сквозь полупрозрачные карточки сообщений */
    background: linear-gradient(180deg, #36393f 0%, #2f3136 35%, #202225 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ticket-transcript-body::-webkit-scrollbar {
    width: 10px;
}
.ticket-transcript-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0 0 0.85rem 0;
}
.ticket-transcript-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}
.ticket-transcript-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}
.ticket-transcript-empty-note {
    padding: 1.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.92rem;
    text-align: center;
    line-height: 1.5;
}
.ticket-transcript-fallback {
    margin: 0;
    border: none;
    border-radius: 0;
}
.ticket-transcript-fallback summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    list-style: none;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 0.2s, color 0.2s;
}
.ticket-transcript-fallback summary:hover {
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
}
.ticket-transcript-fallback summary::-webkit-details-marker {
    display: none;
}
.ticket-transcript-raw {
    margin: 0;
    padding: 1rem 1.2rem 1.2rem;
    max-height: 48vh;
    overflow: auto;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #b8c0ca;
    background: #121316 !important;
    white-space: pre-wrap;
    word-break: break-word;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Транскрипт: стилизованная лента сообщений */
.discord-transcript {
    padding: 1.15rem 1rem 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-feature-settings: 'kern' 1;
}
@media (min-width: 768px) {
    .discord-transcript {
        padding: 1.35rem 1.35rem 1.65rem;
    }
}
.discord-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    /* Непрозрачный фон — иначе родительский градиент даёт «синюю полосу» за шапкой сообщения */
    background: #313338;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.discord-msg:hover {
    background: #36393f;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 24px rgba(0, 0, 0, 0.35);
}
.discord-msg-avatar {
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    text-transform: none;
    background: linear-gradient(145deg, #5865f2 0%, #3c45a5 100%);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.discord-msg-avatar--img {
    display: block;
    object-fit: cover;
    padding: 0;
    font-size: 0;
    text-transform: none;
    background: #1e1f22;
    border: 2px solid rgba(255, 255, 255, 0.12);
}
.discord-msg:nth-child(4n + 2) .discord-msg-avatar:not(.discord-msg-avatar--img) {
    background: linear-gradient(145deg, #57f287 0%, #248046 100%);
}
.discord-msg:nth-child(4n + 3) .discord-msg-avatar:not(.discord-msg-avatar--img) {
    background: linear-gradient(145deg, #faa61a 0%, #c27d12 100%);
}
.discord-msg:nth-child(4n + 4) .discord-msg-avatar:not(.discord-msg-avatar--img) {
    background: linear-gradient(145deg, #eb459e 0%, #9b2d6a 100%);
}
.discord-msg-body {
    min-width: 0;
    flex: 1;
}
.discord-msg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
    margin-bottom: 0.4rem;
    line-height: 1.35;
    background: transparent;
}
.discord-msg-author {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #f2f3f5;
    letter-spacing: 0.01em;
}
.discord-msg-sep {
    color: #5c6370;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    margin: 0 0.05rem;
    transform: translateY(-0.05em);
}
.discord-msg-time {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: #949ba4;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
}
.discord-msg-text {
    font-family: 'Inter', system-ui, sans-serif;
    color: #e3e5e8;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.15rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.discord-inline-link {
    color: #6eb9ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(110, 185, 255, 0.35);
    transition: color 0.15s, border-color 0.15s;
}
.discord-inline-link:hover {
    color: #a8d8ff;
    border-bottom-color: rgba(168, 216, 255, 0.6);
}

.discord-embed {
    --discord-embed-color: #5865f2;
    margin-top: 0.55rem;
    max-width: 34rem;
    border-radius: 0.65rem;
    background: linear-gradient(165deg, #32353b 0%, #232528 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 4px solid var(--discord-embed-color);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.discord-embed-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem 0.75rem 0.85rem;
}
.discord-embed-main {
    min-width: 0;
    flex: 1;
}
.discord-embed-author-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}
.discord-embed-author-icon {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #1e1f22;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.discord-embed-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0;
}
.discord-embed-title {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6eb9ff;
    margin-bottom: 0.4rem;
    text-decoration: none;
    line-height: 1.35;
}
.discord-embed-title:hover {
    text-decoration: underline;
    color: #9fd4ff;
}
.discord-embed-title--text {
    color: #fff;
}
.discord-embed-description {
    font-size: 0.875rem;
    color: #dbdee1;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.35rem;
    line-height: 1.5;
}
.discord-embed-provider {
    font-size: 0.72rem;
    color: #949ba4;
    margin-bottom: 0.35rem;
}
.discord-embed-provider-name {
    margin-right: 0.35rem;
}
.discord-embed-provider-link {
    color: #6eb9ff;
    text-decoration: none;
    word-break: break-all;
}
.discord-embed-provider-link:hover {
    text-decoration: underline;
}
.discord-embed-video {
    margin-bottom: 0.4rem;
}
.discord-embed-video-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6eb9ff;
    text-decoration: none;
}
.discord-embed-video-link:hover {
    color: #a8d8ff;
    text-decoration: underline;
}
.discord-embed-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.5rem 0.75rem;
    margin-top: 0.45rem;
}
.discord-embed-field {
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.discord-embed-field-name {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b5bac1;
    margin-bottom: 0.2rem;
}
.discord-embed-field-value {
    font-size: 0.84rem;
    color: #e3e5e8;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.45;
}
.discord-embed-footer {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: #949ba4;
}
.discord-embed-footer-icon {
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1e1f22;
}
.discord-embed-footer-text {
    line-height: 1.25;
}
.discord-embed-thumb {
    flex-shrink: 0;
    width: 5rem;
    height: 5rem;
    border-radius: 0.4rem;
    object-fit: cover;
    background: #1e1f22;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.discord-embed-image {
    display: block;
    width: 100%;
    max-height: 18rem;
    object-fit: contain;
    background: #1a1c1f;
    border-radius: 0 0 0.55rem 0.55rem;
}
.discord-attachment {
    margin-top: 0.55rem;
}
.discord-attachment-img-link {
    display: inline-block;
    border-radius: 0.55rem;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.discord-attachment-img-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.discord-attachment-img {
    display: block;
    max-width: min(100%, 26rem);
    max-height: 16rem;
    object-fit: contain;
    vertical-align: middle;
}
.discord-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.55rem;
    background: linear-gradient(165deg, #32353b 0%, #232528 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #6eb9ff;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    word-break: break-all;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.discord-attachment-file:hover {
    color: #a8d8ff;
    border-color: rgba(110, 185, 255, 0.35);
    background: linear-gradient(165deg, #3a3e45 0%, #2a2d32 100%);
}

@media (max-width: 576px) {
    .ticket-portal-hero {
        padding: 1.25rem 1.1rem;
    }
    .ticket-portal-title {
        font-size: 1.25rem;
    }
    .ticket-table-card thead th,
    .ticket-table-card tbody td {
        padding: 0.65rem 0.65rem;
        font-size: 0.875rem;
    }
    .ticket-transcript-shell > header {
        padding: 0.85rem 1rem;
    }
    .discord-transcript {
        padding: 0.85rem 0.65rem 1.15rem;
    }
    .discord-msg {
        padding: 0.6rem 0.65rem;
        gap: 0.65rem;
    }
    .discord-embed {
        max-width: 100%;
    }
}
