/* ================================================================
   assets/css/tickets.css
   سیستم تیکتینگ — Next Pro My Account
   ================================================================ */

/* ── WRAP ─────────────────────────────────────────────────────── */
.nxt-tickets-wrap {
    direction: rtl;
    font-family: inherit;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.nxt-tickets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.nxt-tickets-header h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #1c1b19;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.nxt-btn-new-ticket {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary, #00baba);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
    border: none;
    cursor: pointer;
}
.nxt-btn-new-ticket:hover { background: #009e9e; color: #fff !important; }

.nxt-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    color: #374151 !important;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.nxt-btn-back:hover { background: #e5e7eb; color: #111 !important; }

/* ── FILTERS ──────────────────────────────────────────────────── */
.nxt-ticket-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.nxt-filter-pill {
    padding: 5px 16px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}
.nxt-filter-pill:hover,
.nxt-filter-pill.active {
    background: var(--primary, #00baba);
    border-color: var(--primary, #00baba);
    color: #fff;
}

/* ── TICKET LIST ──────────────────────────────────────────────── */
.nxt-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nxt-ticket-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.nxt-ticket-card:hover {
    border-color: var(--primary, #00baba);
    box-shadow: 0 4px 16px rgba(0,186,186,.1);
    transform: translateY(-1px);
    color: inherit;
}

.nxt-ticket-card-main { flex: 1; min-width: 0; }
.nxt-ticket-title {
    font-size: 14px;
    font-weight: 700;
    color: #1c1b19;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nxt-ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.nxt-meta-chip {
    font-size: 11.5px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.nxt-ticket-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

/* ── BADGES ───────────────────────────────────────────────────── */
.nxt-ticket-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.nxt-badge-open    { background: #d1fae5; color: #065f46; }
.nxt-badge-pending { background: #fef3c7; color: #92400e; }
.nxt-badge-closed  { background: #f1f5f9; color: #64748b; }

.nxt-ticket-prio {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}
.nxt-prio-low    { background: #f0fdf4; color: #166534; }
.nxt-prio-normal { background: #dbeafe; color: #1e40af; }
.nxt-prio-high   { background: #ffedd5; color: #9a3412; }
.nxt-prio-urgent { background: #fee2e2; color: #991b1b; }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.nxt-tickets-empty {
    text-align: center;
    padding: 48px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1.5px dashed #e5e7eb;
}
.nxt-tickets-empty span { font-size: 48px; display: block; margin-bottom: 12px; }
.nxt-tickets-empty p { color: #6b7280; margin-bottom: 16px; }

/* ── TICKET INFO BAR ──────────────────────────────────────────── */
.nxt-ticket-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

/* ── CONVERSATION ─────────────────────────────────────────────── */
.nxt-conversation {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.nxt-msg {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.nxt-msg-user  { border-right: 4px solid var(--primary, #00baba); }
.nxt-msg-admin { border-right: 4px solid #059669; }

.nxt-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12.5px;
}
.nxt-msg-user  .nxt-msg-header { background: #f0fafa; }
.nxt-msg-admin .nxt-msg-header { background: #f0fdf4; }

.nxt-msg-avatar { font-size: 18px; }
.nxt-msg-author { font-weight: 700; color: #1c1b19; }
.nxt-msg-date   { color: #9ca3af; font-size: 11.5px; margin-right: auto; }

.nxt-support-badge {
    background: #059669;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.nxt-msg-body {
    padding: 14px 18px;
    font-size: 13.5px;
    line-height: 1.8;
    color: #374151;
}
.nxt-msg-body p { margin: 0 0 8px; }
.nxt-msg-body p:last-child { margin: 0; }

/* ── REPLY FORM ───────────────────────────────────────────────── */
.nxt-reply-form {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 8px;
}
.nxt-reply-form h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1c1b19;
}
.nxt-reply-form textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.7;
    resize: vertical;
    display: block;
    margin-bottom: 12px;
    transition: border-color .15s;
    box-sizing: border-box;
}
.nxt-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary, #00baba);
}

/* ── NEW TICKET FORM ──────────────────────────────────────────── */
.nxt-ticket-form {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}
.nxt-form-row { display: flex; gap: 16px; margin-bottom: 0; flex-wrap: wrap; }
.nxt-form-group { margin-bottom: 16px; flex: 1; min-width: 200px; }
.nxt-col-full  { flex: 0 0 100%; }
.nxt-col-half  { flex: 1; }

.nxt-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}
.nxt-form-group label .req { color: #dc2626; }

.nxt-form-group input,
.nxt-form-group select,
.nxt-form-group textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13.5px;
    color: #1c1b19;
    background: #fff;
    transition: border-color .15s;
    box-sizing: border-box;
}
.nxt-form-group input:focus,
.nxt-form-group select:focus,
.nxt-form-group textarea:focus {
    outline: none;
    border-color: var(--primary, #00baba);
}

.nxt-form-actions { margin-top: 8px; }

/* ── SUBMIT BUTTON ────────────────────────────────────────────── */
.nxt-btn-submit {
    background: var(--primary, #00baba);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nxt-btn-submit:hover { background: #009e9e; }

/* ── ALERTS ───────────────────────────────────────────────────── */
.nxt-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 600;
}
.nxt-alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.nxt-alert-info   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.nxt-alert-success{ background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .nxt-ticket-card { flex-direction: column; align-items: flex-start; }
    .nxt-ticket-card-side { flex-direction: row; }
    .nxt-form-row { flex-direction: column; }
    .nxt-col-half { flex: 0 0 100%; }
}


/* ── SUCCESS ALERT ────────────────────────────────────────────── */
.nxt-alert-animate {
    animation: nxt-slide-in .4s ease;
}
@keyframes nxt-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── FILE INPUT ───────────────────────────────────────────────── */
.nxt-form-group input[type="file"] {
    padding: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 13px;
}
.nxt-file-hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: #9ca3af;
}

/* ── REPLY ATTACHMENT ─────────────────────────────────────────── */
.nxt-reply-attach {
    margin: 12px 0;
}
.nxt-reply-attach label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 5px;
}
.nxt-reply-attach input[type="file"] {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: #f9fafb;
    font-size: 13px;
    box-sizing: border-box;
}

/* ── ATTACHMENTS ──────────────────────────────────────────────── */
.nxt-attachment {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}

.nxt-attach-img-link { display: inline-block; }
.nxt-attach-img {
    max-width: 240px;
    max-height: 160px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    transition: opacity .15s;
}
.nxt-attach-img:hover { opacity: .85; }

.nxt-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, border-color .15s;
    max-width: 320px;
}
.nxt-attach-file:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111;
}
.nxt-attach-icon { font-size: 18px; }
.nxt-attach-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.nxt-attach-dl {
    font-size: 11.5px;
    color: var(--primary, #00baba);
    white-space: nowrap;
}