/* ═══════ CONTACT / SUPPORT PAGE ═══════ */

/* ── Header ── */
.ct-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}
.ct-header h1 { font-size: 2.5rem; margin: 0 0 10px 0; font-weight: 700; }
.ct-header p { font-size: 1.1rem; margin: 0; opacity: 0.9; }

.ct-container { max-width: 900px; margin-bottom: 60px; }

/* ── Section ── */
.ct-section { margin-bottom: 40px; }
.ct-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.ct-section-head h2 { font-size: 1.3rem; margin: 0; font-weight: 600; }

/* ── Ticket List ── */
.ct-tickets { display: flex; flex-direction: column; gap: 10px; }
.ct-ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
.ct-ticket-row:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16,185,129,0.1);
}
.ct-ticket-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.ct-ticket-info { flex: 1; }
.ct-ticket-subject { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.ct-ticket-meta { font-size: 0.85rem; color: #9ca3af; margin-top: 4px; }
.ct-arrow { color: #9ca3af; }
.ct-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Badges ── */
.ct-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.ct-badge-open { background: #dbeafe; color: #2563eb; }
.ct-badge-answered { background: #d1fae5; color: #059669; }
.ct-badge-waiting { background: #fef3c7; color: #d97706; }
.ct-badge-closed { background: #f3f4f6; color: #6b7280; }

/* ── Empty ── */
.ct-empty { text-align: center; padding: 60px 20px; color: #9ca3af; }
.ct-empty i { font-size: 3rem; margin-bottom: 15px; opacity: 0.5; display: block; }

/* ── Form ── */
.ct-form-group { margin-bottom: 18px; }
.ct-form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.ct-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.ct-input:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }
.ct-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.ct-char-count { text-align: right; font-size: 0.8rem; color: #9ca3af; margin-top: 4px; }
.ct-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn-full { width: 100%; padding: 12px; }
.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-outline:hover { border-color: #ef4444; color: #ef4444; }

/* ── Guest Success ── */
.ct-guest-success { text-align: center; padding: 50px 20px; }
.ct-guest-success i { font-size: 4rem; color: #10b981; display: block; margin-bottom: 15px; }
.ct-guest-success h3 { font-size: 1.5rem; margin: 0 0 10px 0; }
.ct-guest-success .ct-sub { color: #9ca3af; font-size: 0.9rem; }

/* ── Modal (logged-in new ticket) ── */
.ct-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.ct-overlay.show { display: flex; }
.ct-modal {
    background: #fff;
    border-radius: 16px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
}
.ct-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}
.ct-modal-head h3 { margin: 0; font-size: 1.2rem; }
.ct-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}
.ct-modal-body { padding: 24px; }

/* ═══════ TICKET CHAT VIEW ═══════ */

.tk-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 30px 20px;
}
.tk-back {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.tk-back:hover { color: white; }
.tk-header-info h1 { font-size: 1.5rem; margin: 0 0 8px 0; font-weight: 600; }
.tk-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; opacity: 0.9; }
.tk-meta .ct-badge { font-size: 0.75rem; }

.tk-container { max-width: 800px; margin-bottom: 60px; }

/* ── Chat ── */
.tk-chat { padding: 30px 0; display: flex; flex-direction: column; gap: 20px; }
.tk-msg { display: flex; gap: 12px; max-width: 85%; }
.tk-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.tk-msg-admin { align-self: flex-start; }

.tk-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.tk-msg-admin .tk-msg-avatar { background: #d1fae5; color: #059669; }
.tk-msg-user .tk-msg-avatar { background: #dbeafe; color: #2563eb; }

.tk-msg-body {
    padding: 14px 18px;
    border-radius: 16px;
    min-width: 200px;
}
.tk-msg-admin .tk-msg-body { background: #f3f4f6; border-bottom-left-radius: 4px; }
.tk-msg-user .tk-msg-body { background: #ecfdf5; border-bottom-right-radius: 4px; }

.tk-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tk-msg-name { font-weight: 600; font-size: 0.85rem; }
.tk-msg-time { font-size: 0.75rem; color: #9ca3af; white-space: nowrap; }
.tk-msg-text { font-size: 0.95rem; line-height: 1.6; color: #374151; }

/* ── Reply Box ── */
.tk-reply { padding: 20px 0; border-top: 1px solid #e5e7eb; }
.tk-reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.tk-reply-btns { display: flex; gap: 10px; }

.tk-closed-bar {
    text-align: center;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 10px;
    color: #6b7280;
    margin-top: 20px;
}

/* ═══════ DARK MODE ═══════ */
[data-theme="dark"] .ct-header,
[data-theme="dark"] .tk-header { background: linear-gradient(135deg, #047857 0%, #065f46 100%); }

[data-theme="dark"] .ct-ticket-row { border-color: #404040; background: #1f2937; }
[data-theme="dark"] .ct-ticket-row:hover { border-color: #10b981; }
[data-theme="dark"] .ct-ticket-subject { color: #f3f4f6; }
[data-theme="dark"] .ct-ticket-meta { color: #6b7280; }

[data-theme="dark"] .ct-badge-open { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .ct-badge-answered { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .ct-badge-waiting { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .ct-badge-closed { background: #27272a; color: #71717a; }

[data-theme="dark"] .ct-input {
    background: #1f2937;
    border-color: #404040;
    color: #f3f4f6;
}
[data-theme="dark"] .ct-input:focus { border-color: #10b981; }

[data-theme="dark"] .ct-modal { background: #1f2937; }
[data-theme="dark"] .ct-modal-head { border-color: #404040; }
[data-theme="dark"] .ct-modal-head h3 { color: #f3f4f6; }

[data-theme="dark"] .tk-msg-admin .tk-msg-body { background: #27272a; }
[data-theme="dark"] .tk-msg-user .tk-msg-body { background: #064e3b; }
[data-theme="dark"] .tk-msg-text { color: #d1d5db; }
[data-theme="dark"] .tk-msg-name { color: #f3f4f6; }

[data-theme="dark"] .tk-reply { border-color: #404040; }
[data-theme="dark"] .tk-closed-bar { background: #27272a; color: #71717a; }
[data-theme="dark"] .btn-outline { border-color: #404040; color: #9ca3af; }
[data-theme="dark"] .btn-outline:hover { border-color: #ef4444; color: #ef4444; }

[data-theme="dark"] .ct-empty { color: #6b7280; }
[data-theme="dark"] .ct-section-head h2 { color: #f3f4f6; }
[data-theme="dark"] .ct-form-group label { color: #d1d5db; }
[data-theme="dark"] .ct-guest-form { color: #d1d5db; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .ct-header h1 { font-size: 1.8rem; }
    .ct-form-row { grid-template-columns: 1fr; }
    .tk-msg { max-width: 95%; }
    .tk-reply-actions { flex-direction: column; gap: 10px; align-items: stretch; }
    .tk-reply-btns { justify-content: flex-end; }
    .ct-section-head { flex-direction: column; gap: 10px; align-items: flex-start; }
}
