/* ========================================
   SUPPORT — Ticket UI styles
   Fintechs client view
   ======================================== */

/* ── 1. FILTER BUTTONS ── */
.sp-filter-btn.active {
    background-color: #0891b2;
    border-color: #0891b2;
    color: #fff;
}

/* ── 2. TICKET CARDS (list) ── */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-card {
    display: block;
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ticket-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.ticket-card:active {
    transform: translateY(0);
}

.ticket-card-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-card-main {
    min-width: 0;
    flex: 1 1 200px;
}

.ticket-status {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .ticket-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .ticket-card {
        height: 100%;
    }

    .ticket-card-row {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1200px) {
    .ticket-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── 3. DETAIL OVERLAY ── */
body.ticket-detail-open {
    overflow: hidden;
}

.ticket-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.50);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 12px;
    z-index: 1050;
    overflow-y: hidden;
}

.ticket-detail-card {
    width: 100%;
    max-width: 860px;
    height: calc(100vh - 32px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ticket-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 14px;
}

/* ── 4. MESSAGES PANEL ── */
.messages-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    border-radius: 12px;
    background: #d1d1d1;
    overflow: hidden;
    margin-top: 12px;
}

.messages-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    overscroll-behavior: contain;
}

/* ── 5. MESSAGE BUBBLES ── */
.msg-bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.msg-mine {
    margin-left: auto;
    background: rgba(8, 145, 178, 0.18);
}

.msg-theirs {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.75);
}

.msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.msg-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    color: #1f2937;
}

/* ── 6. REPLY INPUT ── */
.reply-panel {
    flex: 0 0 auto;
    padding-top: 10px;
}

.reply-input {
    width: 100%;
    min-height: 52px;
    resize: none;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.85);
    color: #111827;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reply-input:focus {
    outline: none;
    border-color: #0891b2;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.reply-input::placeholder {
    color: #9ca3af;
}

/* ── 7. NEW TICKET MODAL ── */
.ticket-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}

.ticket-modal {
    width: 100%;
    max-width: 540px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f3f4f6;
    color: #111827;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.ticket-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.ticket-modal-body {
    padding: 16px;
}

.ticket-modal .form-control,
.ticket-modal .form-select {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.ticket-modal .form-control:focus,
.ticket-modal .form-select:focus {
    background: #ffffff;
    color: #111827;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.ticket-modal .form-control::placeholder {
    color: #9ca3af;
}
