/* ==========================================================================
   WEZEBET - Ticket de Suporte (/ticket)
   Replica da pagina /ticket da WBET com markup/CSS proprios (prefixo wbt-).
   Cor de destaque: verde do site (--rb-gold / #01e0a3).
   ========================================================================== */

.wbt-page {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px 56px;
    box-sizing: border-box;
}

/* ------------------------------- Header -------------------------------- */

.wbt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.wbt-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--rb-text, #fff);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wbt-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}

.wbt-back:hover {
    color: var(--rb-text, #fff);
    border-color: var(--rb-border-strong, rgba(1, 224, 163, .28));
    background: rgba(1, 224, 163, .08);
}

.wbt-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 9px;
    background: var(--rb-gold-gradient, #01e0a3);
    color: var(--rb-gold-deep, #04241b);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s, transform .1s;
}

.wbt-new-btn:hover { filter: brightness(1.06); }
.wbt-new-btn:active { transform: translateY(1px); }

/* --------------------------- Visitante / vazio -------------------------- */

.wbt-guest,
.wbt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 48px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}

.wbt-guest svg,
.wbt-empty svg {
    color: var(--rb-gold, #01e0a3);
    opacity: .9;
}

.wbt-guest h1 {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--rb-text, #fff);
}

.wbt-guest p,
.wbt-empty p {
    margin: 0;
    max-width: 420px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
}

.wbt-guest-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    height: 42px;
    padding: 0 30px;
    border: none;
    border-radius: 9px;
    background: var(--rb-gold-gradient, #01e0a3);
    color: var(--rb-gold-deep, #04241b);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s, transform .1s;
}

.wbt-guest-btn:hover { filter: brightness(1.06); }
.wbt-guest-btn:active { transform: translateY(1px); }

.wbt-empty .wbt-new-btn { margin-top: 4px; }

/* -------------------------------- Lista -------------------------------- */

.wbt-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wbt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .04);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}

.wbt-row:hover {
    border-color: var(--rb-border-strong, rgba(1, 224, 163, .28));
    background: rgba(255, 255, 255, .06);
}

.wbt-row:active { transform: translateY(1px); }

.wbt-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.wbt-status-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rb-gold, #01e0a3);
}

.wbt-row-subject {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--rb-text, #fff);
}

.wbt-row-category {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .06);
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
    font-size: 11px;
    font-weight: 600;
}

.wbt-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wbt-row-date {
    font-size: 12px;
    color: var(--rb-text-faint, rgba(160, 160, 160, .55));
    white-space: nowrap;
}

/* -------------------------------- Estados ------------------------------- */

.wbt-status-dot.wbt-status-open { background: var(--rb-gold, #01e0a3); }
.wbt-status-dot.wbt-status-pending { background: rgb(129, 140, 248); }
.wbt-status-dot.wbt-status-closed { background: var(--rb-text-faint, rgba(160, 160, 160, .55)); }

.wbt-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.wbt-status-badge.wbt-status-open {
    color: var(--rb-gold, #01e0a3);
    background: rgba(1, 224, 163, .12);
}

.wbt-status-badge.wbt-status-pending {
    color: rgb(129, 140, 248);
    background: rgba(129, 140, 248, .14);
}

.wbt-status-badge.wbt-status-closed {
    color: var(--rb-text-faint, rgba(160, 160, 160, .55));
    background: rgba(255, 255, 255, .06);
}

/* ------------------------------- Esqueleto ------------------------------ */

.wbt-skeleton {
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .08) 37%, rgba(255, 255, 255, .04) 63%);
    background-size: 400% 100%;
    animation: wbt-shimmer 1.4s ease infinite;
}

@keyframes wbt-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* -------------------------------- Formulario ---------------------------- */

.wbt-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}

.wbt-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wbt-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
}

.wbt-field input,
.wbt-field select,
.wbt-field textarea,
.wbt-reply textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    color: var(--rb-text, #fff);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.wbt-field textarea,
.wbt-reply textarea {
    resize: vertical;
    min-height: 96px;
}

.wbt-field input::placeholder,
.wbt-field textarea::placeholder,
.wbt-reply textarea::placeholder {
    color: var(--rb-text-faint, rgba(160, 160, 160, .55));
}

.wbt-field input:focus,
.wbt-field select:focus,
.wbt-field textarea:focus,
.wbt-reply textarea:focus {
    border-color: var(--rb-gold, #01e0a3);
    background: rgba(1, 224, 163, .06);
    box-shadow: 0 0 0 3px rgba(1, 224, 163, .12);
}

.wbt-field select option {
    background: var(--rb-card, #191939);
    color: var(--rb-text, #fff);
}

.wbt-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

.wbt-cancel-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}

.wbt-cancel-btn:hover {
    color: var(--rb-text, #fff);
    background: rgba(255, 255, 255, .1);
}

.wbt-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 9px;
    background: var(--rb-gold-gradient, #01e0a3);
    color: var(--rb-gold-deep, #04241b);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s, transform .1s;
}

.wbt-submit-btn:hover:not(:disabled) { filter: brightness(1.06); }
.wbt-submit-btn:active:not(:disabled) { transform: translateY(1px); }

.wbt-submit-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.3);
}

.wbt-error {
    margin: 0;
    font-size: 13px;
    color: #ff7b7b;
}

/* -------------------------------- Detalhe ------------------------------- */

.wbt-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wbt-detail-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wbt-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 460px;
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
}

.wbt-messages::-webkit-scrollbar { width: 8px; }
.wbt-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 8px;
}
.wbt-messages::-webkit-scrollbar-track { background: transparent; }

.wbt-message {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--rb-text, #fff);
}

.wbt-message.is-user {
    align-self: flex-end;
    background: rgba(1, 224, 163, .12);
    border: 1px solid rgba(1, 224, 163, .22);
    border-bottom-right-radius: 4px;
}

.wbt-message.is-support {
    align-self: flex-start;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-bottom-left-radius: 4px;
}

.wbt-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--rb-text-faint, rgba(160, 160, 160, .55));
}

.wbt-message-meta strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
}

.wbt-message p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wbt-message a {
    color: var(--rb-gold, #01e0a3);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wbt-message a:hover { opacity: .82; }

.wbt-reply {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wbt-reply .wbt-submit-btn { align-self: flex-end; }

.wbt-closed-note {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    color: var(--rb-text-soft, rgba(191, 191, 191, .82));
    font-size: 13px;
    text-align: center;
}

/* ------------------------------- Responsivo ----------------------------- */

@media (max-width: 560px) {
    .wbt-page { padding: 16px 12px 48px; }
    .wbt-title { font-size: 18px; }
    .wbt-new-btn { padding: 0 12px; }
    .wbt-row-main { flex-wrap: wrap; }
    .wbt-row-subject { flex-basis: 100%; order: -1; }
    .wbt-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .wbt-row-meta { justify-content: space-between; }
    .wbt-message { max-width: 92%; }
    .wbt-form { padding: 16px; }
}
