/* static/css/style.css */
@import url('https://fontstatic.ir/css/yekan.css');

@font-face {
    font-family: 'iran-yekan';
    src: url('/static/font/IRANYekanX-Medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'iran-sans';
    src: url('/static/font/IRANSansX-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #ff9e7d;
    --accent-color: #ff5252;
    --culinary-primary: #e74c3c;
    --culinary-secondary: #ff7675;
    --culinary-accent: #ff6b6b;
    --culinary-dark: #2c3e50;
    --culinary-light: #fff5f5;
    --culinary-success: #27ae60;
    --culinary-warning: #f39c12;
    --culinary-info: #3498db;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'iran-yekan', 'iran-sans', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-light);
    padding-top: 0px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* رنگ‌های سفارشی برای بوت استرپ */
.bg-culinary {
    background: linear-gradient(135deg, var(--culinary-primary) 0%, var(--culinary-secondary) 100%) !important;
}

.bg-culinary-dark {
    background: linear-gradient(135deg, var(--culinary-dark) 0%, #34495e 100%) !important;
}

.btn-culinary {
    background: linear-gradient(135deg, var(--culinary-primary) 0%, var(--culinary-secondary) 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-culinary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    background: linear-gradient(135deg, var(--culinary-secondary) 0%, var(--culinary-primary) 100%);
}

.btn-culinary-outline {
    border: 2px solid var(--culinary-primary);
    color: var(--culinary-primary);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.btn-culinary-outline:hover {
    background: var(--culinary-primary);
    color: white;
    transform: translateY(-2px);
}

.btn-culinary-light {
    background-color: var(--culinary-light);
    color: var(--culinary-primary);
    border: none;
    transition: var(--transition);
}

.btn-culinary-light:hover {
    background-color: var(--culinary-primary);
    color: white;
}

/* نوبار */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-brand .brand-text {
    background: linear-gradient(273deg, #fad0c4 0%, #ff9a9e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border-radius: var(--border-radius);
    color: white !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.102);
}

/* منوی dropdown */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--culinary-light);
    color: var(--culinary-primary);
}

.category-thumbnail {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

/* فرم جستجو */
.search-form .input-group {
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-form .form-control {
    border: none;
    padding: 0.75rem 1rem;
}

.search-form .form-control:focus {
    box-shadow: none;
}

/* بخش هیرو */
.hero-section {
    position: relative;
    background: linear-gradient(273deg, rgba(231, 76, 60, 0.5) 100%, rgba(255, 118, 117, 0.9) 100%), url('/static/image/background-hero.avif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-bottom: 60px;
    border-radius: 0 0 30px 30px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-search-form {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: var(--shadow-hover);
}

.search-input {
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    width: -webkit-fill-available;
}

.search-input:focus {
    box-shadow: none;
}

.search-btn {
    border-radius: 50px;
    padding: 1rem 2rem;
    white-space: nowrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffd700;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
}

/* بخش‌ها */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--culinary-dark);
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(45deg, var(--culinary-primary), var(--culinary-secondary));
    border-radius: 2px;
}

.section-description {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* کارت دسته‌بندی - بهبود یافته */
.category-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    height: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.category-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.7) 100%);
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--culinary-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-content {
    padding: 1.5rem;
    text-align: center;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/********************************/

/* 🎬 کارت ویدیو */
.video-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* 🎞 بخش تامبنیل ویدیو */
.video-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* حفظ نسبت تصویر استاندارد ویدیو */
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background: #000; /* پس‌زمینه برای تصاویر شفاف یا ناقص */
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center center; /* تمرکز بر وسط تصویر */
    transition: transform 0.5s ease;
    display: block;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.08);
}

/* 🌫 افکت overlay هنگام هاور */
.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

/* 🔘 دکمه پخش */
.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.play-button:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 📝 محتوای پایین کارت */
.video-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.video-title a:hover {
    color: var(--primary-color);
}

/* 📊 متا اطلاعات ویدیو */
.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #777;
    flex-wrap: wrap;
}

.category-badge {
    background: var(--primary-color);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.video-stats {
    display: flex;
    gap: 10px;
}

/* ✍ توضیح کوتاه ویدیو */
.video-description {
    color: #555;
    font-size: 0.9rem;
    margin-top: auto;
}

/* 📱 واکنش‌گرا */
@media (max-width: 768px) {
    .video-card {
        border-radius: 10px;
    }
    .video-title {
        font-size: 1rem;
    }
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}


.video-duration {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
}


.video-stats .stat {
    display: flex;
    align-items: center;
}


/**********************************************/



/* ویژگی‌ها */
.features-section {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f8f9fa 100%);
}

.feature-card {
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--culinary-light) 0%, #ffeaa7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--culinary-primary);
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* فوتر */
.footer {
    margin-top: auto;
    padding: 3rem 0 1rem;
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--culinary-primary);
    border-radius: 1.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    display: block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(-5px);
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.category-tag:hover {
    background: var(--culinary-primary);
    color: white;
    transform: translateY(-2px);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--culinary-primary);
    transform: translateY(-3px);
}

.newsletter-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
}

.newsletter-form .input-group {
    border-radius: 25px;
    overflow: hidden;
}

.newsletter-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: none;
    color: white;
}

.newsletter-form .btn {
    border-radius: 0 25px 25px 0;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
}

.trust-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.trust-badges .badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

/* استایل‌های صفحه جزئیات ویدیو */
.video-detail-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-player-wrapper {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-player-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.video-title-main {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.video-meta-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-badge-large {
    background: linear-gradient(135deg, var(--culinary-primary), var(--culinary-secondary));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

.video-stats-main {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-player-main {
    padding: 0;
}

.iframe-container-large {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.iframe-container-large iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-description-section {
    padding: 2rem;
    border-top: 1px solid #eee;
}

.description-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.video-description-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-light);
    text-align: justify;
}

/* سایدبار */
.video-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}

/* دکمه‌های اشتراک گذاری */
.share-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-hover);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.telegram {
    background: #0088cc;
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.copy-link {
    background: var(--culinary-primary);
}

/* دسته‌بندی */
.category-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    background: var(--culinary-light);
    color: var(--culinary-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 600;
}

.category-link:hover {
    background: var(--culinary-primary);
    color: white;
    transform: translateX(-5px);
}

/* ویدیوهای مشابه */
.related-videos {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-video-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.related-video-item:hover {
    background: var(--culinary-light);
    transform: translateX(-3px);
}

.related-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--culinary-light), #ffeaa7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--culinary-primary);
}

.related-info {
    flex: 1;
}

.related-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.related-views {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* بخش نظرات */
.comments-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.comments-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.comments-count {
    color: var(--culinary-primary);
    font-weight: 600;
}

/* فرم نظر */
.comment-form-card {
    padding: 2rem;
    border-bottom: 1px solid #eee;
}

.form-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.comment-form {
    max-width: 800px;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--culinary-primary);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

/* لیست نظرات */
.comments-list {
    padding: 2rem;
}

.comment-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.comment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--culinary-primary), var(--culinary-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-body {
    margin-bottom: 1rem;
}

.comment-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.comment-footer {
    display: flex;
    justify-content: flex-end;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.like-btn:hover {
    border-color: var(--culinary-primary);
    color: var(--culinary-primary);
    transform: translateY(-1px);
}

.empty-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-comments i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-comments h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* toast برای کپی لینک */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--culinary-success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* استایل بخش محبوب‌ترین ویدیوها */
.popular-videos-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.popular-card {
    position: relative;
    transition: all 0.3s ease;
}

.popular-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.popular-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #ff6b35, #ff8e53);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.popular-stat {
    color: #ff6b35;
    font-weight: bold;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

/* استایل کروسل - بهبود یافته */
.carousel-image-container {
    width: 100%;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(75%);
    transition: all 0.4s ease;
}

.carousel-image-container:hover .carousel-image {
    filter: brightness(100%);
    transform: scale(1.03);
}

/* متن روی تصویر */
.carousel-caption-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.video-count {
    font-size: 1rem;
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 12px;
}

/* کنترل‌های کروسل */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-size: 60%;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

/* بهبود استایل برای تصاویر پیش‌فرض */
.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* بهبود نمایش تصاویر در حالت‌های مختلف */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--culinary-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--culinary-secondary);
}

/* بهینه‌سازی برای موبایل */
@media (max-width: 768px) {
    body {
        padding-top: 0px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .search-container {
        flex-direction: column;
        border-radius: var(--border-radius);
    }

    .search-input,
    .search-btn {
        border-radius: var(--border-radius);
    }

    .hero-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .navbar-nav {
        text-align: right;
        padding: 1rem 0;
    }

    .search-form {
        margin: 1rem 0;
    }

    .user-menu,
    .auth-buttons {
        margin-top: 1rem;
    }

    /* بهبود ریسپانسیو برای تصاویر */
    .category-image {
        height: 180px;
    }
    
    
    
    
    
    .video-thumbnail {
        height: auto !important; /* جلوگیری از ارتفاع ثابت */
    }
    
    .video-thumb-img {
        width: 100%;
        height: auto;
        object-fit: contain; /* تصویر بدون برش کامل نمایش داده می‌شود */
        border-radius: var(--border-radius);
        display: block;
        margin: 0 auto;
    }
    
    .video-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--border-radius);
    }
    
    
    
    
    
    
    

    .carousel-image-container {
        height: 300px;
        max-width: 500px;
    }

    .video-detail-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-sidebar {
        order: 1;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
        border-radius: 0 0 20px 20px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-item {
        flex: 1;
        min-width: 100px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .category-card,
    .video-card {
        margin-bottom: 1rem;
    }

    .footer .row>div {
        margin-bottom: 2rem;
    }

    .social-links {
        justify-content: center;
    }

    /* بهبود ریسپانسیو برای تصاویر در موبایل */
    .category-image,
    .video-thumbnail {
        height: 250px;
    }

    .carousel-image-container {
        height: 250px;
        max-width: 400px;
    }
    
    .category-name {
        font-size: 1.5rem;
    }
    
    .video-count {
        font-size: 0.9rem;
    }

    .video-title-main {
        font-size: 1.5rem;
    }

    .video-meta-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .video-stats-main {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .comments-header,
    .comment-form-card,
    .comments-list {
        padding: 1.5rem;
    }

    .share-buttons {
        justify-content: center;
    }

    .video-player-header,
    .video-description-section {
        padding: 1.5rem;
    }

    .sidebar-card {
        padding: 1.2rem;
    }

    .comment-card {
        padding: 1.2rem;
    }

    .comment-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* بهینه‌سازی برای حالت چاپ */
@media print {
    .navbar,
    .footer,
    .hero-section,
    .btn {
        display: none !important;
    }

    body {
        padding-top: 0;
        background: white;
        color: black;
    }

    .container {
        width: 100%;
        max-width: none;
    }
}

/* بهبود دسترسی */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* حالت تاریک */
/*@media (prefers-color-scheme: dark) {*/
/*    :root {*/
/*        --text-dark: #f8f9fa;*/
/*        --text-light: #adb5bd;*/
/*        --bg-light: #212529;*/
/*        --bg-white: #343a40;*/
/*    }*/

/*    .category-card,*/
/*    .video-card,*/
/*    .feature-card {*/
/*        background: var(--bg-white);*/
/*        color: var(--text-dark);*/
/*    }*/

/*    .video-title a {*/
/*        color: var(--text-dark);*/
/*    }*/
/*}*/


@media (prefers-color-scheme: dark) {
    /* اجبار به استفاده از تم روشن در تمام حالت‌ها */
    :root {
        --text-dark: #2d3436;
        --text-light: #636e72;
        --bg-light: #f8f9fa;
        --bg-white: #ffffff;
    }

    body {
        background-color: var(--bg-light) !important;
        color: var(--text-dark) !important;
    }

    .category-card,
    .video-card,
    .feature-card {
        background: var(--bg-white) !important;
        color: var(--text-dark) !important;
    }

    .video-title a {
        color: var(--text-dark) !important;
    }
}




/* بهبود عملکرد */
img {
    max-width: 100%;
    height: auto;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--culinary-primary);
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--culinary-primary);
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* استایل‌های اضافی برای بهبود نمایش */
.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* بهبود flexbox برای مرکز کردن محتوا */
.d-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* استایل برای تصاویر پیش‌فرض وقتی لود نمی‌شوند */
img:not([src]) {
    background: linear-gradient(135deg, var(--culinary-light), #ffeaa7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--culinary-primary);
}

img:not([src])::before {
    content: "📷";
    font-size: 2rem;
}


/*****************************/


/* استایل برای لینک‌های جدید */
.category-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-title-link:hover .category-title {
    color: var(--culinary-primary);
}

/* اطمینان از نمایش صحیح cursor */
.category-image-link,
.category-title-link {
    cursor: pointer;
}

/* حفظ استایل‌های موجود */
.category-image {
    position: relative;
    cursor: pointer;
}

.category-title {
    transition: var(--transition);
    cursor: pointer;
}

.category-title:hover {
    color: var(--culinary-primary);
}