:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Vazir', 'Tahoma', 'Arial', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.8;
    direction: rtl;
    padding-top: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    background-attachment: fixed;
    font-weight: 400;
}

/* Navigation */
.navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
}

.nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-section h2 {
    font-size: 2.25rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stats-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.code-example {
    background: rgba(0, 0, 0, 0.4);
    padding: 2.5rem;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInRight 0.8s ease-out 0.4s both;
}

.code-example h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    opacity: 0.95;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.code-example pre {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    position: relative;
    padding-right: 3.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.code-example code {
    color: #d4d4d4;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-copy {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: rgba(99, 102, 241, 0.8);
    border: none;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.btn-copy:hover {
    background: rgba(99, 102, 241, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box i {
    position: absolute;
    right: 20px;
    color: var(--text-light);
    z-index: 10;
    font-size: 1.2rem;
}

.search-box input {
    padding: 1rem 1.5rem 1rem 3rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
    outline: none;
    transform: translateY(-2px);
}

.search-box .btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.search-box .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Packages Section */
.packages-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.98);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.filter-buttons .btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.filter-buttons .btn:not(.active) {
    background: white;
    color: var(--text-dark);
    border-color: var(--border-color);
}

.filter-buttons .btn:not(.active):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.package-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.package-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.package-card:hover::before {
    transform: scaleX(1);
}

.package-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.package-card h4::before {
    content: '📦';
    font-size: 1.8rem;
}

.package-card p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.package-card .package-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.package-card .package-version {
    display: inline-block;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.package-card .package-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: var(--secondary-color);
    font-weight: 600;
}

.package-card .btn-view {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.package-card .btn-view:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modal */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-weight: 700;
    font-size: 1.5rem;
}

.btn-close {
    filter: brightness(0) invert(1);
}

.package-versions {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.version-item {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.version-item:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    transform: translateX(-5px);
}

.version-item.active {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    font-weight: 600;
}

.files-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.file-item {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    background: white;
}

.file-item:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: var(--shadow-sm);
}

.file-item .file-info {
    flex: 1;
}

.file-item .file-name {
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.file-item .file-size {
    color: var(--text-light);
    font-size: 0.85rem;
}

.file-url-input {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    width: 100%;
    margin-top: 0.75rem;
    transition: all 0.3s;
}

.file-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.file-item .file-actions {
    display: flex;
    gap: 0.75rem;
    margin-right: 1rem;
}

.file-item .file-actions .btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

/* Stats Section */
.stats-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    animation: bounce 2s infinite;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0;
    margin-top: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.5;
    color: var(--primary-color);
}

.empty-state h4 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Scrollbar */
.files-list::-webkit-scrollbar,
.package-versions::-webkit-scrollbar {
    width: 10px;
}

.files-list::-webkit-scrollbar-track,
.package-versions::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.files-list::-webkit-scrollbar-thumb,
.package-versions::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.files-list::-webkit-scrollbar-thumb:hover,
.package-versions::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section h2 {
        font-size: 1.5rem;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .package-card {
        padding: 1.5rem;
    }
}

/* Toast */
.toast {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px 12px 0 0;
}

.toast-body {
    padding: 1rem 1.5rem;
    font-weight: 500;
}
