/* ============================================================
   SUPORTE.CSS — Sistema de Tickets CHARLINZADA
   ============================================================ */

:root {
    --primary: #ff0000;
    --primary-dark: #cc0000;
    --bg: #0a0a0a;
    --card: #151515;
    --card2: #1a1a1a;
    --border: #222;
    --border2: #333;
    --text: #ffffff;
    --muted: #999999;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    min-height: 100vh;
}

/* ── Wrap ─────────────────────────────────────────────────── */
.suporte-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ── Header ───────────────────────────────────────────────── */
.suporte-header {
    text-align: center;
    margin-bottom: 36px;
}

.suporte-header-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.suporte-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    margin: 0 0 10px;
    letter-spacing: 1px;
}

.suporte-header p {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
}

.text-red { color: var(--primary); }

/* ── Tabs ─────────────────────────────────────────────────── */
.suporte-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 6px;
}

.tab-btn {
    flex: 1;
    padding: 11px 20px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 0, 0, 0.35);
}

.tab-btn:not(.active):hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Card ─────────────────────────────────────────────────── */
.suporte-card {
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}

.suporte-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 22px;
    color: #fff;
}

/* ── Formulário ───────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .suporte-header h1 { font-size: 1.5rem; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    background: #111;
    border: 1px solid var(--border2);
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.12);
}

.form-group select option { background: #111; }

.form-group textarea { resize: vertical; min-height: 110px; }

.char-count {
    font-size: 12px;
    color: #555;
    text-align: right;
    margin-top: 2px;
}

/* ── Botões ───────────────────────────────────────────────── */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.3px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.35);
}

.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.btn-buscar {
    padding: 9px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-buscar:hover { background: var(--primary-dark); }

.btn-voltar {
    padding: 8px 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    border-radius: 8px;
    color: #ccc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-voltar:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Sucesso ──────────────────────────────────────────────── */
.ticket-sucesso {
    text-align: center;
    padding: 30px 20px;
    animation: fadeIn 0.4s ease;
}

.sucesso-icon { font-size: 52px; margin-bottom: 16px; }

.ticket-sucesso h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.ticket-sucesso p { color: var(--muted); margin: 6px 0; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Lista de tickets ─────────────────────────────────────── */
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: rgba(255,255,255,0.03); }

.ticket-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.ticket-row-left strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.ticket-id-badge {
    font-size: 12px;
    font-family: monospace;
    color: var(--primary);
    font-weight: 700;
}

.chevron {
    color: #555;
    font-size: 20px;
    line-height: 1;
}

/* ── Badges de status ─────────────────────────────────────── */
.badge-status {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-status.aberto       { background: rgba(255,153,0,0.15); color: #ff9900; }
.badge-status.em_andamento { background: rgba(88,101,242,0.15); color: #7289DA; }
.badge-status.resolvido    { background: rgba(0,204,102,0.15);  color: #00cc66; }
.badge-status.fechado      { background: rgba(100,100,100,0.15); color: #666; }

.badge-cat {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.06);
    color: #aaa;
    white-space: nowrap;
}

/* ── Estados vazios / loading ─────────────────────────────── */
.empty-tickets {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}
.empty-tickets span { font-size: 48px; display: block; margin-bottom: 14px; opacity: 0.4; }
.empty-tickets p { font-size: 15px; margin: 0; }

.loading-tickets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--muted);
    font-size: 14px;
}

.spinner-mini {
    width: 24px;
    height: 24px;
    border: 3px solid #333;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ── Detalhe / Conversa ───────────────────────────────────── */
.ticket-detalhe { animation: fadeIn 0.3s ease; }

.conversa {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.conversa::-webkit-scrollbar { width: 4px; }
.conversa::-webkit-scrollbar-track { background: transparent; }
.conversa::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.msg {
    border-radius: 10px;
    padding: 14px 18px;
    animation: fadeIn 0.25s ease;
}

.msg-admin {
    background: rgba(255, 0, 0, 0.06);
    border: 1px solid rgba(255, 0, 0, 0.18);
    align-self: flex-end;
    max-width: 90%;
}

.msg-cliente {
    background: #111;
    border: 1px solid var(--border2);
    align-self: flex-start;
    max-width: 90%;
    width: 100%;
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.msg-header strong { font-size: 13px; }
.msg-header span   { font-size: 12px; color: #555; }

.msg p {
    margin: 0;
    font-size: 14px;
    color: #ddd;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Área de resposta ─────────────────────────────────────── */
.responder-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.responder-area textarea {
    padding: 12px 14px;
    background: #111;
    border: 1px solid var(--border2);
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    outline: none;
}

.responder-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}
