/* ============================================
   NetVian - طراحی مدرن و به‌روز
   نسخه 2.0 - طراحی از صفر
   ============================================ */

/* ============================================
   CSS VARIABLES - متغیرهای CSS
   ============================================ */
:root {
    /* Colors - رنگ‌ها */
    --primary: #4caf50;
    --primary-dark: #45a049;
    --primary-light: #81c784;
    --secondary: #1a202c;
    --text: #1a202c;
    --text-light: #4a5568;
    --text-muted: #718096;
    --bg: #ffffff;
    --bg-light: #f7fafc;
    --bg-dark: #1a202c;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    
    /* Typography - تایپوگرافی */
    --font: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Spacing - فاصله‌ها */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Layout - چیدمان */
    --container-max: 1400px;
    --nav-height: 80px;
    --nav-height-mobile: 70px;
    
    /* Transitions - انیمیشن‌ها */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ============================================
   RESET & BASE - ریست و پایه
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
    direction: rtl;
    text-align: right;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll on all elements */
* {
    max-width: 100%;
}

img, video, iframe, svg {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TYPOGRAPHY - تایپوگرافی
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    font-family: var(--font);
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   NAVIGATION - ناوبری
   ============================================ */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.nav-header.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.nav-logo-text {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text);
}

.nav-logo-text .text-primary {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    list-style: none;
    flex: 1;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary);
    background: rgba(76, 175, 80, 0.08);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(76, 175, 80, 0.12);
    font-weight: 700;
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: var(--font-size-base);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-cta:hover,
.nav-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* Desktop/Mobile Only Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Mobile Menu */
.nav-mobile {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    transform: translateX(100%);
    transition: var(--transition);
    z-index: 999;
    overflow-y: auto;
    display: none;
}

.nav-mobile.active {
    transform: translateX(0);
    display: block;
}

.nav-mobile-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-link-mobile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link-mobile:hover,
.nav-link-mobile:focus {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary);
}

.nav-link-mobile.active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--primary);
    font-weight: 700;
}

/* ============================================
   RESPONSIVE - واکنش‌گرا
   ============================================ */
@media (min-width: 769px) {
    .desktop-only {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
    }
    
    .nav-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
    }
    
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    :root {
        --nav-height: var(--nav-height-mobile);
    }
    
    .container {
        padding: 0 1rem !important;
        overflow-x: hidden !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .nav-container {
        padding: 0 var(--spacing-md);
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .nav-cta {
        display: none !important;
    }
    
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-mobile {
        top: var(--nav-height-mobile);
        overflow-x: hidden !important;
        width: 100% !important;
    }
}

/* ============================================
   UTILITIES - ابزارها
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section {
    padding: var(--spacing-2xl) 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font);
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

/* ============================================
   ACCESSIBILITY - دسترسی‌پذیری
   ============================================ */
.skip-link {
    position: absolute;
    top: -100px;
    right: 0;
    background: var(--primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Focus Visible */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HERO SECTION - بخش قهرمان
   ============================================ */
.hero {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(69, 160, 73, 0.05) 100%);
    position: relative;
    overflow: hidden;
    padding: var(--spacing-2xl) 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(76,175,80,0.03)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.5;
}

.hero-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text p {
    font-size: var(--font-size-xl);
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
}

/* ============================================
   CARDS & GRIDS - کارت‌ها و شبکه‌ها
   ============================================ */
.card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(69, 160, 73, 0.1) 100%);
    border-radius: var(--radius-full);
    font-size: 2rem;
    color: var(--primary);
}

.service-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* ============================================
   SECTION HEADERS - هدر بخش‌ها
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-md);
}

.section-header p {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   RESPONSIVE - Mobile First Approach
   ============================================ */

/* Mobile Base Styles (up to 768px) */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
    }
    
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .container {
        padding: 0 1rem !important;
        overflow-x: hidden !important;
    }
    
    :root {
        --nav-height: var(--nav-height-mobile);
        --font-size-base: 0.9375rem; /* 15px */
        --font-size-sm: 0.8125rem; /* 13px */
        --font-size-lg: 1rem; /* 16px */
        --font-size-xl: 1.125rem; /* 18px */
        --font-size-2xl: 1.375rem; /* 22px */
        --font-size-3xl: 1.75rem; /* 28px */
        --font-size-4xl: 2.25rem; /* 36px */
        --spacing-xs: 0.5rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
    }
    
    html {
        font-size: 15px;
    }
    
    /* Container */
    .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-md);
        height: var(--nav-height-mobile);
    }
    
    .nav-logo-img {
        width: 35px;
        height: 35px;
    }
    
    .nav-logo-text {
        font-size: var(--font-size-lg);
    }
    
    .nav-toggle {
        display: flex !important;
        width: 28px;
        height: 22px;
    }
    
    .nav-mobile {
        top: var(--nav-height-mobile);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .nav-link-mobile {
        font-size: var(--font-size-lg);
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    /* Hero Section */
    .hero {
        min-height: calc(100vh - var(--nav-height-mobile));
        padding: var(--spacing-xl) 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
        padding: 0 var(--spacing-md);
    }
    
    .hero-text h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        line-height: 1.3;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-text p {
        font-size: var(--font-size-base);
        line-height: 1.7;
        margin-bottom: var(--spacing-md);
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }
    
    .section-header h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        line-height: 1.3;
        margin-bottom: var(--spacing-sm);
    }
    
    .section-header p {
        font-size: var(--font-size-base);
        line-height: 1.7;
    }
    
    /* Cards & Grids */
    .card-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .service-card {
        padding: var(--spacing-md);
    }
    
    .service-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .service-card h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-base);
        width: 100%;
        max-width: 100%;
    }
    
    /* Typography */
    h1 { font-size: clamp(1.75rem, 8vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
    h4 { font-size: var(--font-size-lg); }
    h5 { font-size: var(--font-size-base); }
    h6 { font-size: var(--font-size-sm); }
    
    p {
        font-size: var(--font-size-base);
        line-height: 1.7;
    }
    
    /* Tables */
    table {
        font-size: var(--font-size-sm);
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: var(--spacing-sm);
        width: 100%;
    }
    
    /* Utilities */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .nav-cta {
        display: none !important;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.625rem;
        --spacing-md: 0.875rem;
        --spacing-lg: 1.25rem;
        --spacing-xl: 1.75rem;
        --spacing-2xl: 2rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .card {
        padding: var(--spacing-sm);
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
    
    .nav-logo-text {
        font-size: var(--font-size-base);
    }
}

/* Tablet (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-content {
        gap: var(--spacing-lg);
    }
}

/* Large Desktop (1025px and up) */
@media (min-width: 1025px) {
    .desktop-only {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
    }
    
    .nav-mobile {
        display: none !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn,
    .nav-link,
    .nav-link-mobile {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .service-card:hover {
        transform: none;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .parallax-hero {
        min-height: 50vh !important;
    }
    
    .nav-header {
        height: 60px;
    }
    
    :root {
        --nav-height-mobile: 60px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS - بهینه‌سازی عملکرد
   ============================================ */
/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Will-change for animations */
.card,
.service-card,
.btn {
    will-change: transform;
}

/* GPU Acceleration */
.hero,
.nav-header {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Print Styles */
@media print {
    .nav-header,
    .nav-mobile,
    .nav-toggle,
    footer {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

