:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #a855f7;
    --neutral: #f8fafc;
    --neutral-dark: #0f172a;
    --card-bg: #ffffff;
    --card-bg-dark: #1e293b;
    --text: #1e293b;
    --text-dark: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.25);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-dark: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Vazir', sans-serif;
    background: var(--neutral);
    color: var(--text);
    line-height: 1.7;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body[data-theme="dark"] {
    background: var(--neutral-dark);
    color: var(--text-dark);
}

header {
    background: var(--gradient);
    padding: 8rem 2rem 12rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

body[data-theme="dark"] header {
    background: var(--gradient-dark);
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 45%);
    opacity: 0.6;
    z-index: 1;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

header h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out both;
}

header p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.nav-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    background: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    z-index: 1200;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .nav-toggle {
    background: var(--secondary);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    margin: 5px auto;
    border-radius: 3px;
    transition: var(--transition);
}

.nav-toggle.active {
    transform: rotate(180deg);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    width: 30px;
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    width: 30px;
}

nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    padding: 6rem 1.5rem 3rem;
    transition: var(--transition);
    z-index: 1100;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

nav.active {
    left: 0;
}

body[data-theme="dark"] nav {
    background: rgba(15, 23, 42, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

body[data-theme="dark"] nav a {
    color: var(--text-dark);
}

nav a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

nav a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transition: var(--transition);
    transform: scaleY(0);
    transform-origin: bottom;
}

nav a:hover::before,
nav a.active::before {
    transform: scaleY(1);
}

nav a:hover,
nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    transform: translateX(-5px);
}

body[data-theme="dark"] nav a:hover,
body[data-theme="dark"] nav a.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
}

main {
    max-width: 1400px;
    margin: -6rem auto 5rem;
    padding: 0 2rem;
    flex: 1;
    position: relative;
    z-index: 3;
}

.section {
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: translateY(30px);
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin: 5rem 0;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform-style: preserve-3d;
    perspective: 1000px;
}

body[data-theme="dark"] .feature-card {
    background: var(--card-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: var(--shadow-lg);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--gradient);
    transition: var(--transition);
}

.feature-card:hover::before {
    height: 10px;
}

.feature-card .icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

body[data-theme="dark"] .feature-card .icon-container {
    background: rgba(139, 92, 246, 0.1);
}

.feature-card:hover .icon-container {
    transform: scale(1.1) translateY(-5px);
    background: var(--gradient);
}

.feature-card:hover .icon-container i {
    color: white;
}

.feature-card .icon-container i {
    font-size: 2.5rem;
    color: var(--primary);
    transition: var(--transition);
}

body[data-theme="dark"] .feature-card .icon-container i {
    color: var(--secondary);
}

.feature-card h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    font-weight: 700;
}

body[data-theme="dark"] .feature-card h2 {
    color: var(--secondary);
}

.feature-card p {
    font-size: 1.1rem;
    margin: 1rem 0;
    color: var(--text);
    opacity: 0.9;
}

body[data-theme="dark"] .feature-card p {
    color: var(--text-dark);
}

.download-section {
    margin: 6rem 0;
    padding: 5rem 4rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.6));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body[data-theme="dark"] .download-section {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    z-index: -1;
}

.download-section h2 {
    font-size: clamp(2rem, 6vw, 3.2rem);
    color: var(--primary);
    margin-bottom: 2.5rem;
    font-weight: 700;
    position: relative;
}

body[data-theme="dark"] .download-section h2 {
    color: var(--secondary);
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.button {
    background: var(--gradient);
    color: white;
    padding: 1.1rem 3.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    position: relative;
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
}

.button:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: all 0.6s ease;
    z-index: -1;
}

.button:hover::before {
    transform: translateX(100%);
}

.button.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    box-shadow: 
        0 4px 15px rgba(139, 92, 246, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.button.secondary:hover {
    box-shadow: 
        0 8px 25px rgba(139, 92, 246, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.button .loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

.button.loading .loader {
    display: inline-block;
}

.button.loading i {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.download-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.button:hover .download-tooltip {
    opacity: 1;
    bottom: 120%;
}

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    z-index: 1000;
}

body[data-theme="dark"] .theme-toggle {
    background: var(--gradient-dark);
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

.theme-toggle i {
    font-size: 1.4rem;
    color: white;
    transition: var(--transition);
}

footer {
    background: var(--gradient);
    padding: 8rem 2rem 4rem;
    text-align: center;
    color: white;
    clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 100%);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

body[data-theme="dark"] footer {
    background: var(--gradient-dark);
}

footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%23ffffff' opacity='0.1'/%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' fill='%23ffffff' opacity='0.1'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: bottom;
}

footer p {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

footer span {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1025px) {
    .nav-toggle {
        display: none;
    }
    
    nav {
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        padding: 1.2rem 2rem;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: var(--shadow-sm);
        z-index: 1000;
        backdrop-filter: blur(10px);
    }
    
    body[data-theme="dark"] nav {
        background: rgba(15, 23, 42, 0.97);
    }
    
    nav ul {
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
    }
    
    nav a {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
    }
    
    nav a:hover,
    nav a.active {
        transform: translateY(-3px);
    }
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: block;
    }
    
    header {
        padding: 5rem 1.5rem 9rem;
    }
    
    main {
        margin-top: -5rem;
    }
    
    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 4rem 1rem 7rem;
        clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    }
    
    header h1 {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        margin: 4rem 0;
    }
    
    .download-section {
        padding: 3.5rem 2rem;
        margin: 4rem 0;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    nav {
        width: 260px;
    }
    
    .feature-card {
        padding: 2rem 1.5rem;
    }
    
    .download-section {
        padding: 3rem 1.5rem;
    }
    
    footer {
        padding: 6rem 1.5rem 3rem;
        clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 100%);
    }
}