/* ============================================================
   Ticket App - Custom styles
   Extends/overrides Veusy dashboard (it.coranto.app.static)
   ============================================================ */

/* ---- Ticket status badges ---- */
.ticket-badge-open    { background-color: #34c38f; color: #fff; }
.ticket-badge-progress { background-color: #f1b44c; color: #212529; }
.ticket-badge-pending { background-color: #50a5f1; color: #fff; }
.ticket-badge-closed  { background-color: #74788d; color: #fff; }

/* ---- Priority badges ---- */
.ticket-priority-low      { background-color: #34c38f; color: #fff; }
.ticket-priority-medium   { background-color: #f1b44c; color: #212529; }
.ticket-priority-high     { background-color: #f46a6a; color: #fff; }
.ticket-priority-critical { background-color: #343a40; color: #fff; }

/* ---- Ticket detail: conversation thread ---- */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ticket-message {
    display: flex;
    gap: 0.75rem;
}

.ticket-message.is-admin {
    flex-direction: row-reverse;
}

.ticket-message .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ticket-message .message-avatar.user-avatar {
    background-color: #e0e6f0;
    color: #556ee6;
}

.ticket-message .message-avatar.admin-avatar {
    background-color: #556ee6;
    color: #fff;
}

.ticket-message .message-body {
    max-width: 75%;
}

.ticket-message .message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    word-break: break-word;
}

.ticket-message.is-user .message-bubble {
    background-color: #f5f6f8;
    border: 1px solid #eff2f7;
}

.ticket-message.is-admin .message-bubble {
    background-color: #556ee6;
    color: #fff;
}

.ticket-message .message-meta {
    font-size: 0.75rem;
    color: #74788d;
    margin-top: 0.25rem;
}

.ticket-message.is-admin .message-meta {
    text-align: right;
}

/* ---- Ticket list table ---- */
.ticket-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #74788d;
    border-bottom: 2px solid #eff2f7;
}

/* ---- New ticket form ---- */
.ticket-form-card {
    max-width: 720px;
    margin: 0 auto;
}

.ticket-form-card .card-header {
    background: linear-gradient(135deg, #556ee6 0%, #6f42c1 100%);
    color: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
}

.ticket-form-card .card-header h5 {
    color: #fff;
    margin-bottom: 0;
}

/* ---- Reply textarea ---- */
.ticket-reply-box {
    border: 1px solid #eff2f7;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #fafbfc;
}

.ticket-reply-box textarea {
    border: none;
    background: transparent;
    resize: vertical;
    min-height: 100px;
    width: 100%;
}

.ticket-reply-box textarea:focus {
    outline: none;
    box-shadow: none;
}

/* ---- Pagination ---- */
.ticket-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* ---- Empty state ---- */
.ticket-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #74788d;
}

.ticket-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #ced4da;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
    .ticket-message .message-body {
        max-width: 90%;
    }
}
