/* ============================================
   🎨 متغیرهای رنگی
   ============================================ */
:root {
    /* تم تیره */
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-1: #00d4ff;
    --accent-2: #00ff88;
    --accent-3: #7b2ff7;
    --card-hover: rgba(0, 212, 255, 0.15);
    --gradient-1: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    --gradient-2: linear-gradient(135deg, #7b2ff7 0%, #00d4ff 100%);
}

[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --text-primary: #1a1f3a;
    --text-secondary: rgba(26, 31, 58, 0.7);
    --accent-1: #0099cc;
    --accent-2: #00cc6a;
    --accent-3: #5a1fb8;
    --card-hover: rgba(0, 153, 204, 0.1);
}

/* ============================================
   🌍 ریست و پایه
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease;
    position: relative;
}

/* پس‌زمینه متحرک */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(123, 47, 247, 0.08) 0%, transparent 60%);
    z-index: -1;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(3deg); }
}

/* ============================================
   🏠 هدر
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s;
}

.logo:hover {
    transform: rotate(5deg) scale(1.05);
    border-color: var(--accent-1);
}

.logo svg {
    width: 35px;
    height: 35px;
}

.site-title {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   🔍 جستجو
   ============================================ */
.search-section {
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* ============================================
   🌓 دکمه تغییر تم
   ============================================ */
.theme-toggle {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.sun-icon,
.moon-icon {
    transition: all 0.3s;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon,
:root:not([data-theme="light"]) .moon-icon {
    display: none;
}

/* ============================================
   📦 کانتینر اصلی
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   🎯 گرید فایل‌ها
   ============================================ */
.files-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

/* ============================================
   📇 کارت فایل
   ============================================ */
.file-card {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.file-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.file-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-1);
    box-shadow: 
        0 20px 40px rgba(0, 212, 255, 0.2),
        0 0 30px rgba(0, 212, 255, 0.1);
}

.file-card:hover::before {
    opacity: 0.1;
}

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 12px;
    transition: all 0.3s;
}

.card-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.file-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.download-badge {
    position: absolute;
    bottom: 15px;
    padding: 5px 15px;
    background: var(--gradient-1);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.file-card:hover .download-badge {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   ❌ پیام عدم وجود نتیجه
   ============================================ */
.no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
    text-align: center;
}

.no-results.show {
    display: flex;
}

.no-results svg {
    opacity: 0.5;
}

.no-results p {
    font-size: 1.2rem;
}

/* ============================================
   📱 ریسپانسیو
   ============================================ */
@media (max-width: 1024px) {
    .files-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .logo-section {
        width: 100%;
        justify-content: center;
    }
    
    .search-section {
        width: 100%;
        max-width: 100%;
    }
    
    .files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .container {
        padding: 30px 20px;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }
    
    .logo {
        width: 42px;
        height: 42px;
    }
    
    .logo svg {
        width: 28px;
        height: 28px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .theme-toggle {
        width: 42px;
        height: 42px;
    }
    
    .search-box input {
        padding: 10px 40px 10px 15px;
        font-size: 0.9rem;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .card-title {
        font-size: 0.85rem;
    }
}

/* ============================================
   🎬 انیمیشن‌ها
   ============================================ */
.file-card {
    animation: fadeInUp 0.6s ease backwards;
}

.file-card:nth-child(1) { animation-delay: 0.05s; }
.file-card:nth-child(2) { animation-delay: 0.1s; }
.file-card:nth-child(3) { animation-delay: 0.15s; }
.file-card:nth-child(4) { animation-delay: 0.2s; }
.file-card:nth-child(5) { animation-delay: 0.25s; }
.file-card:nth-child(6) { animation-delay: 0.3s; }
.file-card:nth-child(7) { animation-delay: 0.35s; }
.file-card:nth-child(8) { animation-delay: 0.4s; }
.file-card:nth-child(9) { animation-delay: 0.45s; }
.file-card:nth-child(10) { animation-delay: 0.5s; }
.file-card:nth-child(11) { animation-delay: 0.55s; }
.file-card:nth-child(12) { animation-delay: 0.6s; }
.file-card:nth-child(13) { animation-delay: 0.65s; }
.file-card:nth-child(14) { animation-delay: 0.7s; }
.file-card:nth-child(15) { animation-delay: 0.75s; }
.file-card:nth-child(16) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* مخفی کردن کارت‌ها در جستجو */
.file-card.hidden {
    display: none;
}


