@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f0f13;
    --bg-secondary: #1a1a24;
    --bg-card: #1e1e2e;
    --bg-input: #252538;
    --bg-hover: #2a2a3e;
    --border: #2e2e44;
    --border-focus: #6c5ce7;
    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #6a6a80;
    --accent: #6c5ce7;
    --accent-hover: #7c6ef7;
    --accent-glow: rgba(108,92,231,0.15);
    --success: #22c55e;
    --success-bg: rgba(34,197,94,0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.1);
    --info: #3b82f6;
    --info-bg: rgba(59,130,246,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.7;
    min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 20px; }

/* ─── Header ─── */
.support-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a1030 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 20px;
    text-align: center;
}
.support-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.support-header p { color: var(--text-secondary); font-size: 15px; }

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-hover); }

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

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-focus); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }

/* ─── FAQ ─── */
.faq-search {
    position: relative;
    margin-bottom: 20px;
}
.faq-search input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.faq-search input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.faq-search input::placeholder { color: var(--text-muted); }
.faq-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.faq-category-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.faq-category-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    transition: var(--transition);
}
.faq-item:hover { border-color: var(--border-focus); }
.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}
.faq-question .arrow {
    transition: transform 0.3s;
    font-size: 12px;
    color: var(--text-muted);
}
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.9;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 20px 16px; }

/* ─── Suggested FAQ ─── */
.suggested-faq {
    background: var(--info-bg);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}
.suggested-faq h4 {
    font-size: 13px;
    color: var(--info);
    margin-bottom: 8px;
}

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group label .required { color: var(--danger); }

input[type="text"], input[type="tel"], input[type="number"],
textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 120px; }
select option { background: var(--bg-card); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ─── OTP ─── */
.otp-section { text-align: center; }
.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin: 16px 0;
}
.otp-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 0;
}
.otp-timer { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.otp-timer span { color: var(--accent); font-weight: 600; }

/* ─── Steps ─── */
.steps {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
}
.step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-input);
    transition: var(--transition);
}
.step.active { background: var(--accent); }
.step.done { background: var(--success); }

/* ─── Ticket Status ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-reviewing { background: var(--info-bg); color: var(--info); }
.status-answered { background: var(--success-bg); color: var(--success); }
.status-closed { background: rgba(100,100,120,0.15); color: var(--text-muted); }

.priority-normal { }
.priority-urgent { border-right: 3px solid var(--warning); }
.priority-critical { border-right: 3px solid var(--danger); }

/* ─── Chat / Replies ─── */
.chat-messages { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.8;
    position: relative;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-left: 4px;
}
.chat-msg.admin {
    align-self: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.chat-msg .msg-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}
.chat-msg .msg-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 12px;
    margin-top: 6px;
    text-decoration: none;
    color: inherit;
}

/* ─── File Upload ─── */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.file-upload:hover { border-color: var(--accent); background: var(--accent-glow); }
.file-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload .upload-icon { font-size: 32px; margin-bottom: 8px; }
.file-upload p { color: var(--text-muted); font-size: 13px; }
.file-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.file-preview .file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.file-preview .remove-file {
    cursor: pointer;
    color: var(--danger);
    font-weight: 700;
}

/* ─── Rating ─── */
.rating-stars { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.rating-stars .star {
    font-size: 32px;
    cursor: pointer;
    color: var(--border);
    transition: var(--transition);
}
.rating-stars .star:hover,
.rating-stars .star.active { color: var(--warning); }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.3s;
    font-family: inherit;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--info); color: #fff; }

/* ─── Loading ─── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .container { padding: 12px; }
    .support-header { padding: 28px 16px; }
    .support-header h1 { font-size: 22px; }
    .card { padding: 16px; }
    .otp-inputs input { width: 42px; height: 48px; font-size: 18px; }
    .tabs { flex-direction: column; }
    .chat-msg { max-width: 95%; }
}
