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

:root {
    --bg: #101113;
    --panel: #191b1f;
    --panel2: #22252a;
    --text: #f5f5f5;
    --muted: #a5a8af;
    --red: #ff5135;
    --border: #30343b;
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--red);
}

button, input, textarea, select {
    font-family: inherit;
}

/* Header */

.top {
    min-height: 70px;
    padding: 12px max(4vw, 18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #17191d;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 21px;
    font-weight: 800;
    white-space: nowrap;
}

.brand b {
    color: var(--red);
}

nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.navbtn,
.btn {
    background: var(--red);
    color: white !important;
    border: 0;
    border-radius: 10px;
    padding: 9px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    transition: .2s ease;
}

.navbtn:hover,
.btn:hover {
    background: #e94027;
    transform: translateY(-1px);
}

/* Main */

.container {
    width: min(1180px, 92%);
    margin: 28px auto 70px;
    min-height: 60vh;
}

.hero {
    padding: 38px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 10% 10%, #5b211b, transparent 40%),
        linear-gradient(120deg, #25272c, #17191d);
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.hero h1 {
    font-size: clamp(25px, 4vw, 40px);
    margin: 8px 0;
}

.hero p,
.muted {
    color: var(--muted);
}

.eyebrow {
    color: var(--red);
    font-weight: 700;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.section-head h2,
h2 {
    font-size: 22px;
}

/* Video grid */

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.video-card {
    min-width: 0;
}

.thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: #25282e;
    border-radius: 13px;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3a1d1b, #25282e);
    color: var(--red);
    font-size: 38px;
}

.video-info {
    padding: 9px 2px;
}

.video-title {
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-link {
    display: block;
    font-size: 13px;
}

.small {
    font-size: 12px;
}

/* Cards and forms */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 25px;
}

.auth {
    max-width: 480px;
    margin: 35px auto;
}

.auth h1,
.form-page h1 {
    margin-top: 0;
}

form label {
    display: block;
    margin: 15px 0;
    font-weight: 600;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: #101216;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--red);
}

textarea {
    resize: vertical;
}

.btn.full {
    width: 100%;
    margin-top: 10px;
}

.btn.secondary {
    background: #343941;
}

.btn.danger {
    background: #a92f27;
}

.form-page {
    max-width: 720px;
    margin: auto;
}

/* Messages */

.notice {
    padding: 12px 15px;
    border-radius: 10px;
    background: #242b35;
    margin: 15px 0;
}

.notice.error {
    background: #3a211f;
    color: #ffb0a6;
}

.notice.success {
    background: #173126;
    color: #a6f0c5;
}

/* Video player */

.player {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
}

.player video {
    display: block;
    width: 100%;
    max-height: 70vh;
    aspect-ratio: 16 / 9;
}

.watch-layout {
    max-width: 950px;
    margin: auto;
}

.watch-title {
    font-size: 25px;
    margin-bottom: 4px;
}

.watch-meta {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.creator-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.creator-row form {
    margin-right: auto;
}

.creator-name {
    font-weight: 700;
}

.action-row {
    padding: 14px 0;
}

.pill-btn {
    background: var(--panel2);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 0;
    color: var(--text);
    cursor: pointer;
}

.pill-btn:disabled {
    opacity: .5;
}

.description {
    white-space: normal;
    background: var(--panel);
    padding: 16px;
    border-radius: 12px;
    margin: 10px 0 25px;
}

/* Comments */

.comments {
    margin-top: 25px;
}

.comment-form textarea {
    margin-bottom: 10px;
}

.comment {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.comment p {
    margin: 5px 0;
}

.comment .small {
    margin-right: 12px;
}

/* Channel */

.channel-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #51231e;
    color: #ff9b89;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 800;
}

.channel-details {
    flex: 1;
    min-width: 200px;
}

.channel-details h1 {
    margin: 0;
}

/* Empty state */

.empty {
    text-align: center;
    padding: 45px;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 15px;
    color: var(--muted);
}

/* Statistics */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 20px 0;
}

.stat {
    background: var(--panel);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.stat b {
    font-size: 25px;
    color: var(--red);
}

.stat span {
    color: var(--muted);
}

/* Tables */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

td,
th {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.small-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Footer */

footer {
    text-align: center;
    color: #777;
    border-top: 1px solid var(--border);
    padding: 25px;
    font-size: 13px;
}

/* Responsive */

@media (max-width: 850px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .top {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        gap: 12px;
    }

    .container {
        margin-top: 18px;
    }
}

@media (max-width: 540px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 24px;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
    }

    .top {
        padding: 12px 4%;
    }

    nav {
        gap: 10px;
        font-size: 13px;
    }

    .watch-title {
        font-size: 20px;
    }
}


/* اصلاح نمایش موبایل RustCraft Video */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

* {
    min-width: 0;
}

.top {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 10px;
}

.brand {
    width: 100%;
    text-align: right;
}

nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 14px;
    font-size: 13px;
}

.container {
    width: calc(100% - 32px);
    max-width: 100%;
    margin: 18px auto 50px;
}

.hero {
    width: 100%;
    padding: 22px 18px;
    overflow-wrap: anywhere;
}

.hero h1 {
    font-size: clamp(23px, 7vw, 32px);
    line-height: 1.8;
}

.hero p {
    font-size: 14px;
}

.section-head {
    width: 100%;
    flex-wrap: wrap;
}

.grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
}

.video-card,
.video-info,
.thumb {
    width: 100%;
    min-width: 0;
}

.watch-meta {
    flex-wrap: wrap;
}

@media (min-width: 541px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 851px) {
    .top {
        flex-direction: row;
        align-items: center;
    }

    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =====================================
   RustCraft Video - New Features
===================================== */

/* Video thumbnails */

.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #22252a;
    border: 1px solid var(--border);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.video-card:hover .thumb img {
    transform: scale(1.04);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

/* Profile avatar */

.avatar,
.profile-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--red);
    background: var(--panel2);
}

/* Comment actions */

.comment form {
    margin-top: 10px;
}

.comment .btn.danger {
    padding: 5px 13px;
    font-size: 12px;
    border-radius: 8px;
}

.comment .creator-row {
    border: 0;
    padding: 0;
}

/* Like button */

.pill-btn {
    transition: .2s ease;
}

.pill-btn:hover:not(:disabled) {
    background: #3b2422;
    color: #ff7562;
}

.pill-btn:disabled {
    cursor: not-allowed;
}

/* Upload form */

#uploadForm {
    width: 100%;
}

#uploadForm label {
    margin: 18px 0;
}

#uploadForm input[type="file"] {
    cursor: pointer;
    padding: 12px;
    background: #15171b;
}

#uploadForm input[type="file"]::file-selector-button {
    background: var(--red);
    color: white;
    border: 0;
    padding: 8px 13px;
    border-radius: 7px;
    margin-left: 10px;
    cursor: pointer;
    font-family: inherit;
}

/* Thumbnail preview */

#thumbnailPreviewBox {
    background: var(--panel2);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
}

#thumbnailPreview {
    display: block;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
}

/* Upload progress */

#progressBox {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    background: var(--panel2);
    border-radius: 12px;
}

#progressBar {
    background: linear-gradient(
        90deg,
        #e94027,
        #ff5135
    );
    box-shadow: 0 0 12px rgba(255, 81, 53, .35);
}

#progressPercent {
    color: var(--red);
    font-variant-numeric: tabular-nums;
}

#progressStatus {
    margin-bottom: 0;
}

/* Disabled upload button */

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

/* Responsive forms */

@media (max-width: 540px) {

    .form-page {
        padding: 17px;
    }

    #uploadForm .btn {
        width: 100%;
    }

    #thumbnailPreview {
        max-width: 100%;
    }

    .comment .creator-row {
        align-items: flex-start;
    }

    .creator-row form {
        margin-right: 0;
    }

    .watch-layout {
        width: 100%;
    }

    .player {
        border-radius: 10px;
    }

    .description {
        overflow-wrap: anywhere;
    }
} .video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
}

.video-player video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}