﻿/* 
 * استایل‌های بخش دانلود و فوتر - فیلمینجو
 * ریسپانسیو حرفه‌ای - تمام سایزها
 */

/* ===========================
   Download + Blog Container
   =========================== */
.download-blog-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.download-section {
    flex: 1 1 0%;
    min-width: 0;
    width: 65%;
}

/* روی تبلت و موبایل: عمودی */
@media (max-width: 1100px) {
    .download-blog-container {
        flex-direction: column;
        gap: 2.5rem;
    }
    .download-section {
        width: 100%;
    }
    #blog-container {
        width: 100%;
        min-width: 0;
    }
}

/* ===========================
   Section Header
   =========================== */

/* موبایل اول (base) */
.section-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.section-header p {
    color: #94a3b8;
    font-size: 0.85rem;
    max-width: 500px;
    margin: 0 auto;
}

/* تبلت */
@media (min-width: 601px) {
    .section-header    { margin-bottom: 1rem; }
    .section-header h2 { font-size: 1.5rem; }
    .section-header p  { font-size: 0.875rem; }
}

/* دسکتاپ */
@media (min-width: 769px) {
    .section-header    { margin-bottom: 2rem; }
    .section-header h2 { font-size: 1.9rem; }
    .section-header p  { font-size: 0.95rem; }
}

/* ===========================
   Filter Bar (Download)
   =========================== */

/* موبایل اول (base) */
.filter-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.search-box {
    position: relative;
    width: 100%;
    min-width: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    border-radius: 8px;
    border: 1.5px solid #3a3a3a;
    background: #2a2a2a;
    color: #f5f5f5;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    flex: 1;
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,140,255,0.15);
}
.search-box input::placeholder { color: #64748b; }

.search-box .search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 0.85rem;
    line-height: 1;
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.filter-btn {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: #2a2a2a;
    color: #cbd5e1;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.filter-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* تبلت و بالاتر */
@media (min-width: 481px) {
    .filter-options {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .filter-btn {
        justify-content: flex-start;
        font-size: 0.8rem;
    }
}

/* دسکتاپ */
@media (min-width: 769px) {
    .filter-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.875rem;
        margin-bottom: 1.5rem;
    }
    .search-box {
        flex: 1 1 220px;
    }
    .filter-options { gap: 0.6rem; }
    .filter-btn { font-size: 0.8rem; padding: 0.55rem 1rem; }
}

/* ===========================
   Download Grid
   =========================== */
.download-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* لپ‌تاپ کوچک */
@media (max-width: 1280px) {
    .download-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}

/* تبلت */
@media (max-width: 900px) {
    .download-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* موبایل */
@media (max-width: 480px) {
    .download-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* موبایل خیلی کوچک */
@media (max-width: 360px) {
    .download-grid { grid-template-columns: 1fr; gap: 0.875rem; }
}

/* ===========================
   Download Card
   =========================== */
.download-card {
    background: rgba(42,42,42,0.85);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    position: relative;
    border: 1px solid rgba(0,140,255,0.15);
    display: flex;
    flex-direction: column;
}
.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,140,255,0.25);
    border-color: rgba(0,140,255,0.35);
}

/* روی موبایل hover کمتر */
@media (max-width: 600px) {
    .download-card:hover { transform: translateY(-3px); }
}

.card-image-wrapper { position: relative; width: 100%; }

.card-image {
    width: 100% !important;
    height: 175px !important;
    object-fit: cover !important;
    display: block !important;
}

@media (max-width: 1024px) { .card-image { height: 160px !important; } }
@media (max-width: 768px)  { .card-image { height: 145px !important; } }
@media (max-width: 480px)  { .card-image { height: 130px !important; } }

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.card-rating-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fbbf24;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.card-rating-overlay i { color: #fbbf24; }

/* ===========================
   Card Content
   =========================== */
.card-content {
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #f8fafc;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
.card-info span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.genre-badge {
    background: rgba(0,140,255,0.15);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    word-break: break-word;
}

.imdb-badge {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.875rem;
    font-size: 0.875rem;
    color: #fbbf24;
    font-weight: 600;
}
.card-rating i { color: #fbbf24; }

/* ریسپانسیو card-content */
@media (max-width: 480px) {
    .card-content { padding: 0.5rem 0.6rem; }
    .card-title   { font-size: 0.82rem; min-height: 2.2em; }
    .card-info    { font-size: 0.7rem; }
}

/* ===========================
   Download Buttons
   =========================== */
.download-options {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.btn-download {
    flex: 1;
    padding: 0.45rem 0.4rem;
    border-radius: 7px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { background: #0070CC; }

.btn-secondary {
    background: #2a2a2a;
    color: #e2e8f0;
    border: 1px solid #3a3a3a;
}
.btn-secondary:hover {
    background: #3a3a3a;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .download-options { gap: 0.5rem; }
    .btn-download { padding: 0.55rem 0.4rem; font-size: 0.75rem; }
    /* مخفی کردن متن دکمه‌ها روی موبایل کوچک - فقط آیکون */
    .btn-download .btn-text { display: none; }
}

@media (max-width: 360px) {
    .download-options { flex-direction: column; }
    .btn-download .btn-text { display: inline; }
}

/* ===========================
   Pagination
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(0,140,255,0.15);
    flex-wrap: wrap;
}

.page-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #2a2a2a;
    color: #e2e8f0;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
}
.page-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-nav {
    width: auto;
    padding: 0 0.875rem;
    background: rgba(0,140,255,0.12) !important;
    color: var(--primary-color) !important;
    border: 1px solid rgba(0,140,255,0.3) !important;
    font-weight: 700 !important;
}
.page-nav:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(0,140,255,0.3);
}
.page-nav:disabled, .page-nav[disabled] {
    opacity: 0.4 !important;
    pointer-events: none !important;
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.08) !important;
}

.pagination-dots {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    padding: 0 0.3rem;
    user-select: none;
}

@media (max-width: 480px) {
    .page-btn { width: 34px; height: 34px; font-size: 0.8rem; }
    .pagination { gap: 0.4rem; }
}

/* ===========================
   No Results
   =========================== */
.download-section .no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
    font-size: 1rem;
    background: rgba(42,42,42,0.5);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}
.download-section .no-results::before {
    content: '';
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0.5;
}

/* ===========================
   Footer
   =========================== */
.footer-container {
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border-top: 1px solid rgba(0,140,255,0.15);
    position: relative;
    overflow: hidden;
    margin-top: 3rem;
}

.footer-column { position: relative; z-index: 2; }

.footer-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 36px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 3px;
}

.footer-links li { margin-bottom: 12px; }
.footer-links a {
    display: inline-block;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.875rem;
    padding: 2px 0;
    transition: color 0.2s ease, transform 0.2s ease;
}
.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(-4px);
}

.social-icon {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
    color: inherit;
    border-radius: 50%;
}
.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,140,255,0.3);
    background: rgba(0,140,255,0.2);
    border-color: rgba(0,140,255,0.4);
}

/* ریسپانسیو Footer */
@media (max-width: 768px) {
    .footer-container { margin-top: 2rem; }
    .footer-links a { font-size: 0.825rem; }
}
@media (max-width: 480px) {
    .footer-links a:hover { transform: none; }
}

/* ===========================
   انیمیشن‌های Footer
   =========================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ===========================
   Sort Dropdown
   =========================== */
.sort-dropdown-wrapper { position: relative; }

.sort-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(42,42,42,0.9);
    color: white;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
}
.sort-toggle-btn:hover { border-color: var(--primary-color); }
.sort-toggle-btn.sort-open { border-color: var(--primary-color); }

.sort-chevron {
    transition: transform 0.25s ease, color 0.2s;
    color: #6b7280;
}
.sort-toggle-btn.sort-open .sort-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.sort-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.sort-dropdown-menu.open { display: block; }

.sort-option {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.sort-option:hover {
    background: rgba(0,140,255,0.1);
    color: var(--primary-color);
}
.sort-option.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(0,140,255,0.06);
}

/* ===========================
   Filter Chevron / Toggle
   =========================== */
.filter-chevron {
    transition: transform 0.25s ease, color 0.2s;
    color: #6b7280;
}
#filter-toggle-btn.filter-open .filter-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}
