/* ============================================
   تیکان - استایل‌های عمومی و ۹ دیزاین
   ============================================ */

.tikan-wrapper {
    font-family: var(--tikan-font, Vazirmatn, Tahoma, sans-serif);
    font-size: var(--tikan-font-size, 15px);
    color: var(--tikan-text, #1f2937);
    background: var(--tikan-bg, #fff);
    max-width: 680px;
    margin: 0 auto;
    direction: rtl;
    box-sizing: border-box;
}

.tikan-wrapper *,
.tikan-wrapper *::before,
.tikan-wrapper *::after {
    box-sizing: border-box;
}

.tikan-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tikan-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95em;
}

.tikan-input,
.tikan-textarea,
.tikan-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--tikan-radius, 12px);
    background: var(--tikan-input-bg, #f9fafb);
    color: var(--tikan-text);
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tikan-input::placeholder,
.tikan-textarea::placeholder {
    color: var(--tikan-placeholder, #9ca3af);
}

.tikan-input:focus,
.tikan-textarea:focus,
.tikan-select:focus {
    outline: none;
    border-color: var(--tikan-primary, #4f46e5);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tikan-primary) 25%, transparent);
}

.tikan-textarea {
    resize: vertical;
    min-height: 140px;
}

/* آپلود */
.tikan-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: var(--tikan-radius, 12px);
    padding: 1.5rem;
    text-align: center;
    background: var(--tikan-input-bg);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.tikan-upload-area:hover,
.tikan-upload-area.dragover {
    border-color: var(--tikan-primary);
    background: color-mix(in srgb, var(--tikan-primary) 6%, white);
}

.tikan-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.tikan-upload-placeholder {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
}

.tikan-upload-icon {
    font-size: 1.8rem;
}

.tikan-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.tikan-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.tikan-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tikan-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--tikan-danger, #ef4444);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* کپچا */
.tikan-captcha-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tikan-captcha-question {
    background: color-mix(in srgb, var(--tikan-primary) 12%, white);
    padding: 0.6rem 1rem;
    border-radius: var(--tikan-radius);
    font-weight: 700;
    font-size: 1.1em;
    min-width: 100px;
    text-align: center;
}

.tikan-captcha-input {
    max-width: 120px;
}

/* دکمه */
.tikan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    background: var(--tikan-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: var(--tikan-radius, 12px);
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.tikan-btn:hover {
    background: color-mix(in srgb, var(--tikan-primary) 85%, black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--tikan-primary) 35%, transparent);
}

.tikan-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.tikan-actions {
    margin-top: 0.5rem;
}

/* پیام‌ها */
.tikan-message-box {
    padding: 1rem 1.25rem;
    border-radius: var(--tikan-radius);
    font-weight: 500;
}

.tikan-message-box.success {
    background: color-mix(in srgb, var(--tikan-success) 15%, white);
    color: var(--tikan-success);
    border: 1px solid color-mix(in srgb, var(--tikan-success) 30%, white);
}

.tikan-message-box.error {
    background: color-mix(in srgb, var(--tikan-danger) 12%, white);
    color: var(--tikan-danger);
    border: 1px solid color-mix(in srgb, var(--tikan-danger) 25%, white);
}

.tikan-login-required {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #f8fafc;
    border-radius: var(--tikan-radius, 12px);
    border: 1px solid #e2e8f0;
}

.tikan-login-required .tikan-btn {
    margin-top: 1rem;
}

/* ========== دیزاین‌های مدرن (۵ عدد) ========== */

/* modern-1 : کارت نرم با سایه */
.tikan-design-modern-1 {
    padding: 2rem;
    border-radius: calc(var(--tikan-radius) + 4px);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.12);
    border: 1px solid #f1f5f9;
}

/* modern-2 : گرادیان ظریف */
.tikan-design-modern-2 {
    padding: 2rem;
    border-radius: calc(var(--tikan-radius) + 6px);
    background: linear-gradient(145deg, var(--tikan-bg) 0%, color-mix(in srgb, var(--tikan-primary) 4%, white) 100%);
    border: 1px solid color-mix(in srgb, var(--tikan-primary) 15%, transparent);
}

.tikan-design-modern-2 .tikan-btn {
    background: linear-gradient(135deg, var(--tikan-primary), var(--tikan-secondary));
}

/* modern-3 : مینیمال فلت */
.tikan-design-modern-3 {
    padding: 1.75rem;
    border-radius: 0;
    border-top: 4px solid var(--tikan-primary);
    background: #fff;
}

.tikan-design-modern-3 .tikan-input,
.tikan-design-modern-3 .tikan-textarea,
.tikan-design-modern-3 .tikan-select {
    border-radius: 4px;
    border-width: 1px;
}

/* modern-4 : شیشه‌ای (glass) */
.tikan-design-modern-4 {
    padding: 2rem;
    border-radius: calc(var(--tikan-radius) + 8px);
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* modern-5 : نئومورفیسم ملایم */
.tikan-design-modern-5 {
    padding: 2.25rem;
    border-radius: calc(var(--tikan-radius) + 10px);
    background: #f0f2f5;
    box-shadow: 8px 8px 16px #d1d5db, -8px -8px 16px #ffffff;
}

.tikan-design-modern-5 .tikan-input,
.tikan-design-modern-5 .tikan-textarea {
    box-shadow: inset 3px 3px 6px #d1d5db, inset -3px -3px 6px #fff;
    border: none;
}

/* ========== دیزاین‌های کلاسیک (۴ عدد) ========== */

/* classic-1 : ساده و تمیز */
.tikan-design-classic-1 {
    padding: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fafafa;
}

.tikan-design-classic-1 .tikan-input,
.tikan-design-classic-1 .tikan-textarea,
.tikan-design-classic-1 .tikan-select {
    border-radius: 3px;
    border: 1px solid #bbb;
    background: #fff;
}

.tikan-design-classic-1 .tikan-btn {
    border-radius: 3px;
    background: #333;
}

/* classic-2 : جدول‌مانند */
.tikan-design-classic-2 {
    padding: 0;
    border: 2px solid #2c3e50;
    border-radius: 0;
}

.tikan-design-classic-2 .tikan-form {
    padding: 1.5rem;
}

.tikan-design-classic-2 .tikan-field {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.tikan-design-classic-2 .tikan-btn {
    border-radius: 0;
    background: #2c3e50;
}

/* classic-3 : بوردر ضخیم */
.tikan-design-classic-3 {
    padding: 1.75rem;
    border: 3px double #555;
    border-radius: 8px;
    background: #fffef8;
}

.tikan-design-classic-3 .tikan-btn {
    background: #555;
    border-radius: 4px;
}

/* classic-4 : استایل قدیمی فرم */
.tikan-design-classic-4 {
    padding: 1.5rem;
    background: #eef2f7;
    border: 1px solid #a0aec0;
    border-radius: 6px;
}

.tikan-design-classic-4 label {
    color: #2d3748;
}

.tikan-design-classic-4 .tikan-input,
.tikan-design-classic-4 .tikan-textarea {
    background: #fff;
    border: 1px solid #a0aec0;
    border-radius: 4px;
}

.tikan-design-classic-4 .tikan-btn {
    background: #3182ce;
    border-radius: 4px;
}

/* رسپانسیو */
@media (max-width: 600px) {
    .tikan-wrapper {
        padding: 1.25rem !important;
    }
    .tikan-captcha-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* FAQ Suggestions */
.tikan-faq-suggestions {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
}
.tikan-subject-field { position: relative; }
.tikan-faq-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.92em;
    transition: background 0.15s;
}
.tikan-faq-item:last-child { border-bottom: none; }
.tikan-faq-item:hover {
    background: color-mix(in srgb, var(--tikan-primary, #4f46e5) 8%, white);
}
.tikan-faq-item strong {
    color: var(--tikan-primary, #4f46e5);
}

/* FAQ Popup */
.tikan-faq-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}
.tikan-faq-popup {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    direction: rtl;
}
.tikan-faq-popup h3 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    padding-left: 2rem;
}
.tikan-faq-popup-body {
    line-height: 1.7;
    color: #374151;
}
.tikan-faq-close {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.15s;
}
.tikan-faq-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ========== تیکت‌های من ========== */
.tikan-my-tickets,
.tikan-single-ticket {
    max-width: 720px;
    margin: 0 auto;
    direction: rtl;
    font-family: var(--tikan-font, Vazirmatn, Tahoma, sans-serif);
    font-size: var(--tikan-font-size, 15px);
    color: var(--tikan-text, #1f2937);
}

.tikan-my-header {
    margin-bottom: 1.25rem;
}
.tikan-my-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.tikan-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #f8fafc;
    border-radius: var(--tikan-radius, 12px);
    color: #64748b;
}

.tikan-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tikan-ticket-card {
    display: block;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--tikan-radius, 12px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tikan-ticket-card:hover {
    border-color: var(--tikan-primary, #4f46e5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.tikan-ticket-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.tikan-ticket-number {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}
.tikan-status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.tikan-ticket-subject {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}
.tikan-ticket-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* تک تیکت */
.tikan-single-header {
    margin-bottom: 1.5rem;
}
.tikan-back-link {
    display: inline-block;
    font-size: 0.88rem;
    color: var(--tikan-primary, #4f46e5);
    text-decoration: none;
    margin-bottom: 0.75rem;
}
.tikan-back-link:hover { text-decoration: underline; }
.tikan-single-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.tikan-single-title-row h2 {
    margin: 0;
    font-size: 1.2rem;
}
.tikan-single-meta {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

/* گفتگو */
.tikan-conversation {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.tikan-bubble {
    max-width: 85%;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
}
.tikan-bubble.user {
    align-self: flex-start;
    background: color-mix(in srgb, var(--tikan-primary, #4f46e5) 12%, white);
    border-bottom-right-radius: 4px;
}
.tikan-bubble.admin {
    align-self: flex-end;
    background: #f1f5f9;
    border-bottom-left-radius: 4px;
}
.tikan-bubble-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.tikan-bubble-author { font-weight: 600; }
.tikan-bubble-body {
    line-height: 1.65;
}
.tikan-bubble-body p:last-child { margin-bottom: 0; }
.tikan-bubble-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.tikan-bubble-files img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}
.tikan-read-receipt {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.35rem;
    text-align: left;
}

.tikan-user-reply {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: var(--tikan-radius, 12px);
    padding: 1.15rem;
}
.tikan-user-reply-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.tikan-btn-outline {
    background: transparent !important;
    color: var(--tikan-primary, #4f46e5) !important;
    border: 1.5px solid var(--tikan-primary, #4f46e5) !important;
}
.tikan-btn-outline:hover {
    background: color-mix(in srgb, var(--tikan-primary) 8%, white) !important;
}
.tikan-closed-notice {
    text-align: center;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: var(--tikan-radius, 12px);
    color: #64748b;
    border: 1px solid #e2e8f0;
}

@media (max-width: 600px) {
    .tikan-bubble { max-width: 95%; }
    .tikan-single-meta { flex-direction: column; gap: 0.25rem; }
}
