@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #07090e;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(201, 168, 106, 0.5);
    --text: #f3f4f6;
    --text-muted: #8b92a0;
    --accent: #c9a86a;
    --accent-bg: rgba(201, 168, 106, 0.12);
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.glow-bg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 400px;
    background: radial-gradient(circle at top, rgba(201, 168, 106, 0.07) 0%, rgba(13, 20, 38, 0.05) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-container {
    width: 100%;
    max-width: 620px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* هدر و بج */
.header-box {
    margin-bottom: 30px;
    text-align: center;
}

.badge {
    display: inline-block;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid rgba(201, 168, 106, 0.2);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
}

.header-box h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.header-box p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

/* انیمیشن Lottie */
.lottie-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.lottie-box dotlottie-player {
    width: 140px;
    height: 140px;
    filter: drop-shadow(0 4px 15px rgba(201, 168, 106, 0.15));
}

/* کارت عمومی */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* فیلدها و فرم */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 8px;
}

.input-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.input-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

textarea.input-control {
    resize: vertical;
    min-height: 140px;
    line-height: 1.8;
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #0c0e12;
    box-shadow: 0 4px 18px rgba(201, 168, 106, 0.2);
}

.btn-primary:hover {
    background: #d8b87c;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid var(--border);
    width: auto;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
    width: auto;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.card-footer-nav {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.card-footer-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.card-footer-nav a:hover {
    text-decoration: underline;
}

/* هشدارها */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 22px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

/* وضعیت‌ها و پیام‌ها */
.ticket-detail {
    margin-top: 24px;
}

.ticket-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}

.ticket-status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-new {
    background: rgba(201, 168, 106, 0.15);
    color: var(--accent);
    border: 1px solid rgba(201, 168, 106, 0.3);
}

.status-answered {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-closed {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.msg-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.msg-box.admin {
    border-color: rgba(201, 168, 106, 0.25);
    background: rgba(201, 168, 106, 0.03);
}

.msg-box-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.msg-box.admin .msg-box-header strong {
    color: var(--accent);
}

.msg-box-body {
    font-size: 14px;
    line-height: 1.9;
    color: #e5e7eb;
}

/* =========================================
   پنل ادمین (چیدمان و اسکرول دقیق)
   ========================================= */
.admin-container {
    width: 100%;
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* سایدبار سمت راست */
.admin-sidebar-box {
    width: 360px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.sidebar-search {
    margin-bottom: 14px;
}

/* کانتینر اسکرول تیکت‌ها */
.tickets-scroll-area {
    max-height: 620px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 106, 0.4) transparent;
}

.tickets-scroll-area::-webkit-scrollbar {
    width: 5px;
}

.tickets-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.tickets-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 106, 0.4);
    border-radius: 999px;
}

.tickets-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 106, 0.7);
}

.ticket-item-link {
    display: block;
    padding: 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.ticket-item-link:hover {
    background: var(--surface-hover);
}

.ticket-item-link.active {
    background: var(--accent-bg);
    border-color: rgba(201, 168, 106, 0.35);
}

.ticket-item-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ستون سمت چپ (فرم پاسخ) */
.admin-content-box {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-height: 480px;
}

/* فوتر */
footer.global-footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px solid var(--border);
}

footer.global-footer strong {
    color: var(--accent);
}

/* ریسپانسیو موبایل */
@media (max-width: 860px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar-box {
        width: 100%;
    }
    .tickets-scroll-area {
        max-height: 360px;
    }
    .card, .admin-content-box {
        padding: 24px 20px;
    }
}
