/* دانلود برنامه‌ها - Download Page */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
}

/* هدر صفحه */
.page-header {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    border-bottom: 2px solid rgba(79, 172, 254, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(79, 172, 254, 0.1) 0%,
        rgba(0, 242, 254, 0.1) 100%);
    z-index: -1;
}

.page-header h1 {
    font-size: 2.8rem;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
}

.page-header .subtitle {
    color: #a0c8ff;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* کانتینر اصلی */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* لیست برنامه‌ها */
.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* کارت برنامه */
.app-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(79, 172, 254, 0.05) 0%,
        rgba(0, 242, 254, 0.05) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.app-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-color: rgba(79, 172, 254, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    margin: 0 auto 1.5rem;
    object-fit: cover;
    border: 3px solid rgba(79, 172, 254, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.app-card:hover img {
    transform: scale(1.05);
    border-color: rgba(79, 172, 254, 0.6);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.app-card h2 {
    color: #4facfe;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-card p {
    color: #b0d0ff;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* دکمه دانلود */
.app-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.app-card a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(45deg, #00f2fe, #4facfe);
    transition: width 0.4s;
    z-index: -1;
}

.app-card a:hover::before {
    width: 100%;
}

.app-card a:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.4);
}

.app-card a:active {
    transform: translateY(-1px);
}

/* بجای ایکون از متن استفاده می‌کنیم */
.app-card a::after {
    content: '⬇️';
    font-size: 1.1rem;
}

/* دکمه بازگشت */
.back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #a0c8ff;
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

.back::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: rgba(79, 172, 254, 0.1);
    transition: width 0.4s;
    z-index: -1;
}

.back:hover {
    color: #4facfe;
    border-color: #4facfe;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.back:hover::before {
    width: 100%;
}

.back::after {
    content: '←';
    font-size: 1.2rem;
}

/* فیلتر جستجو */
.search-filter {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.search-box::after {
    content: '🔍';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #4facfe;
    font-size: 1.2rem;
}

/* فیلتر دسته‌بندی */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0c8ff;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.9rem;
}

.category-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.category-btn.active {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    border-color: transparent;
}

/* اطلاعات برنامه */
.app-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #8aa8d8;
}

.app-size, .app-version {
    display: flex;
    align-items: center;
    gap: 5px;
}

.app-size::before {
    content: '💾';
}

.app-version::before {
    content: '🏷️';
}

/* پشتیبانی از تاریک/روشن */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.dark-mode-toggle:hover {
    background: rgba(79, 172, 254, 0.3);
    transform: scale(1.1);
}

/* ریسپانسیو */
@media (max-width: 1200px) {
    .app-list {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .app-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .app-card {
        padding: 1.5rem;
    }
    
    .app-card h2 {
        font-size: 1.3rem;
    }
    
    .search-filter {
        padding: 0 0.5rem;
    }
    
    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .app-list {
        grid-template-columns: 1fr;
    }
    
    .app-card img {
        width: 100px;
        height: 100px;
    }
    
    .back {
        width: 90%;
        text-align: center;
    }
    
    .dark-mode-toggle {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
}

/* انیمیشن‌ها */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }
.app-card:nth-child(5) { animation-delay: 0.5s; }
.app-card:nth-child(6) { animation-delay: 0.6s; }

/* استایل برای حالت بارگذاری */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #4facfe;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* استایل برای پیام خالی */
.empty-message {
    text-align: center;
    padding: 3rem;
    color: #8aa8d8;
    font-size: 1.2rem;
}

.empty-message::before {
    content: '📱';
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}
.page-header .nav-links {
    justify-self: center;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-header .nav-links a {
    color: #ddd;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header .nav-links a:hover {
    background: linear-gradient(45deg, #00dbde, #fc00ff);
    color: #fff;
    transform: translateY(-2px);
}

/* استایل برای چند دکمه در یک کارت */
.download-buttons {
    display: flex;
    flex-direction: column; /* چیدمان عمودی */
    gap: 12px; /* فاصله بین دکمه‌ها */
    margin-top: 1rem;
    width: 100%;
}

/* یا اگر می‌خواهید دکمه‌ها کنار هم باشند */
.download-buttons.horizontal {
    flex-direction: row; /* چیدمان افقی */
    justify-content: center;
    flex-wrap: wrap;
}