@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0a0a0c;
    --bg-soft: #101013;
    --card: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --orange: #ee731a;
    --orange-light: #ff9142;
    --text: #f2f2f2;
    --text-dim: #9a9a9f;
    --green: #35c37a;
    --red: #e8503f;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    min-height: 100vh;
}

body {
    position: relative;
    overflow-x: hidden;
}

/* --- پس‌زمینه دکوراتیو (شبیه سایت اصلی رکسان) --- */
.ellipse-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.ellipse {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}
.ellipse.orange { background: var(--orange); top: -180px; right: -160px; }
.ellipse.dark { background: #3a1c05; bottom: -220px; left: -180px; }

.wrap {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

/* --- هدر --- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 12px;
    flex-wrap: wrap;
}
.site-header .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-header .logo-area img { height: 40px; }
.site-header .logo-area .title { font-weight: 700; font-size: 18px; }
.site-header .logo-area .title span { color: var(--orange); }

.badge-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: all .2s;
}
.badge-link:hover { border-color: var(--orange); color: var(--orange-light); }

/* --- کارت شیشه‌ای --- */
.glass-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
}
.page-title h1 {
    font-size: 26px;
    margin: 0 0 8px;
}
.page-title h1 span { color: var(--orange); }
.page-title p {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
    line-height: 1.9;
}

/* --- دراپ‌زون آپلود --- */
.dropzone {
    border: 2px dashed var(--card-border);
    border-radius: 14px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-dim);
}
.dropzone.dragover, .dropzone:hover {
    border-color: var(--orange);
    background: rgba(238, 115, 26, 0.06);
    color: var(--text);
}
.dropzone svg { margin-bottom: 10px; opacity: .7; }
.dropzone input[type=file] { display: none; }
.dropzone .hint { font-size: 12px; margin-top: 6px; color: var(--text-dim); }

/* --- لیست فایل‌های انتخابی --- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    gap: 10px;
}
.file-item .fi-name {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.file-item .fi-name .fi-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(238,115,26,0.12);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--orange-light);
    font-size: 12px;
}
.file-item .fi-meta { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.file-item .fi-remove {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    flex-shrink: 0;
}
.file-item .fi-name span.fname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea.description-box {
    width: 100%;
    min-height: 90px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    padding: 14px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-top: 6px;
}
textarea.description-box:focus { outline: none; border-color: var(--orange); }

label.field-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 22px;
    display: block;
}

/* --- دکمه‌ها --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--orange);
    color: #1a1a1a;
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.btn:hover { background: var(--orange-light); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.btn-block { width: 100%; margin-top: 24px; }
.btn.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text);
}
.btn.btn-outline:hover { border-color: var(--orange); color: var(--orange-light); }
.btn.btn-danger { background: var(--red); color: #fff; }
.btn.btn-danger:hover { background: #ff6a58; }
.btn.btn-sm { padding: 9px 16px; font-size: 12.5px; }

/* --- نوار پیشرفت --- */
.progress-wrap {
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 16px;
    display: none;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    transition: width .2s;
}

/* --- نتیجه آپلود / نمایش کد --- */
.result-box { text-align: center; }
.result-box .code {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--orange);
    background: rgba(238,115,26,0.08);
    border: 1px solid rgba(238,115,26,0.3);
    border-radius: 16px;
    padding: 22px 10px;
    margin: 20px 0;
    direction: ltr;
}
.result-box .copy-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: -6px;
    margin-bottom: 20px;
}
.notice-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 2;
    text-align: right;
}
.notice-box b { color: var(--orange-light); }

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error { background: rgba(232,80,63,0.1); border-color: rgba(232,80,63,0.4); color: #ffb3ab; }
.alert-success { background: rgba(53,195,122,0.1); border-color: rgba(53,195,122,0.4); color: #8ff0bc; }

/* --- فرم‌های ادمین --- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=number] {
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    padding: 13px 14px;
    font-family: inherit;
    font-size: 14px;
}
.form-group input:focus { outline: none; border-color: var(--orange); }

.center-page {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.center-page .glass-card { width: 100%; max-width: 400px; }

/* --- جدول‌ها / لیست‌ها --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 12px 10px;
    text-align: right;
    border-bottom: 1px solid var(--card-border);
}
.data-table th { color: var(--text-dim); font-weight: 600; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 18px;
}
.stat-card .num { font-size: 24px; font-weight: 800; color: var(--orange); }
.stat-card .lbl { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.topbar .who { font-size: 13px; color: var(--text-dim); }
.topbar .who b { color: var(--text); }

.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.nav-tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
}
.nav-tabs a.active, .nav-tabs a:hover { border-color: var(--orange); color: var(--orange-light); background: rgba(238,115,26,0.06); }

.file-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(232,80,63,0.1);
    border: 1px solid rgba(232,80,63,0.3);
    color: #ffb3ab;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
}

footer.site-footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 50px;
}
footer.site-footer a { color: var(--orange-light); text-decoration: none; }

@media (max-width: 600px) {
    .result-box .code { font-size: 30px; letter-spacing: 4px; }
    .wrap { padding: 20px 14px 60px; }
}

/* --- گالری پیش‌نمایش فایل‌ها (عکس/ویدیو) --- */
.file-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.gallery-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gallery-thumb {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    border: 1px solid var(--card-border);
}
.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-thumb.gallery-generic {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 12px;
    cursor: default;
}
.gallery-thumb .play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}
.gallery-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11.5px;
}
.gallery-meta .fname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.gallery-meta .fi-meta { color: var(--text-dim); }

/* --- لایت‌باکس پیش‌نمایش بزرگ‌شده --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(5,5,6,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}
.lightbox.open { display: flex; }
.lightbox-inner {
    position: relative;
    max-width: min(92vw, 1000px);
    max-height: 88vh;
    width: 100%;
}
.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 88vh;
}
.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 12px;
    display: block;
}
.lightbox-close {
    position: absolute;
    top: -46px;
    left: 0;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.lightbox-close:hover { border-color: var(--orange); color: var(--orange-light); }

/* --- اسکرول افقی جدول‌ها روی موبایل --- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table { min-width: 480px; }

@media (max-width: 640px) {
    .file-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .topbar { flex-direction: column; align-items: flex-start; }
    .lightbox-close { top: -42px; padding: 7px 14px; font-size: 12px; }
}

@media (max-width: 420px) {
    .file-gallery { grid-template-columns: repeat(2, 1fr); }
    .page-title h1 { font-size: 21px; }
    .glass-card { padding: 20px; }
}
