/* ============================================
   YEKAN BAKH FONT FACE - MOBILE OPTIMIZED
============================================ */

/* 1. ابتدا فونت fallback تعریف کنیم */
@font-face {
    font-family: 'Vazirmatn Fallback';
    src: local('Tahoma'), local('Arial');
    size-adjust: 95%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: normal;
    unicode-range: U+0600-06FF;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}


/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
============================================ */
:root {
    /* Color Palette */
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #6c8aff;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --accent-light: #80ddf7;
    --dark: #2b2d42;
    --dark-light: #404258;
    --light: #f8f9fa;
    --light-dark: #e9ecef;
    --gray: #adb5bd;
    --gray-light: #e9ecef;
    --gray-dark: #6c757d;
    --success: #4ade80;
    --success-dark: #22c55e;
    --danger: #e74c3c;
    --danger-dark: #c53030;
    --warning: #f39c12;
    --warning-dark: #d97706;
    --info: #3498db;

    /* Typography */
    --font-primary: 'Vazirmatn', Tahoma, Arial, sans-serif;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    --font-size-6xl: 3.75rem;   /* 60px */

    /* Spacing */
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px */

    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;

    /* Shadows */
    --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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   BASE STYLES
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: #f5f7ff;
    color: var(--dark);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    padding-top: 76px;
}



/* ============================================
   TYPOGRAPHY UTILITIES
============================================ */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }

.font-thin { font-weight: 100; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.6; }
.leading-relaxed { line-height: 1.75; }
.leading-loose { line-height: 2; }

/* ============================================
   NAVBAR - MODERN GLASS MORPHISM
============================================ */
#mainNavbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    padding: var(--spacing-3) 0;

}

#mainNavbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 8px 32px rgba(0, 0, 0, 0.12);
    padding: var(--spacing-2) 0;
}

/* Logo */
.logo-minimal {
    width: 42px;
    height: 42px;
    object-fit: contain;
    transition: all var(--transition-base);
    filter: drop-shadow(0 2px 4px rgba(67, 97, 238, 0.1));
}

.logo-minimal:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(67, 97, 238, 0.2));
}

/* Navigation Links */
.nav-link {
    color: var(--dark) !important;
    font-weight: 600;
    padding: var(--spacing-2) var(--spacing-4) !important;
    margin: 0 var(--spacing-1);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.nav-link:hover {
    /* color: black !important; */
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    color: var(--primary) !important;
    background: rgba(67, 97, 238, 0.08);
}

.nav-hover-effect {
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%) scaleX(0);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform var(--transition-base);
    opacity: 0;
}

.nav-link:hover .nav-hover-effect,
.nav-link.active .nav-hover-effect {
    transform: translateX(50%) scaleX(1);
    opacity: 1;
}

/* CTA Button */
.hover-lift {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hover-lift::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.hover-lift:hover::before {
    opacity: 1;
}

/* Mobile Menu */
@media (max-width: 992px) {
    #navbarContent {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-radius: var(--radius-xl);
        padding: var(--spacing-4);
        margin-top: var(--spacing-4);
        box-shadow: var(--shadow-2xl);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .nav-link {
        padding: var(--spacing-3) var(--spacing-4) !important;
        margin: var(--spacing-1) 0;
        text-align: center;
    }

    .logo-minimal {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   HERO SECTION - MODERN GRADIENT
============================================ */
.hero {
    background: linear-gradient(135deg,
        rgba(248, 250, 252, 0.95) 0%,
        rgba(241, 245, 249, 0.9) 50%,
        rgba(236, 240, 245, 0.85) 100%
    );
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(67, 97, 238, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 201, 240, 0.1) 0%, transparent 50%);
}

.hero h1 {
    font-size: var(--font-size-5xl);
    font-weight: 900;
    background: linear-gradient(135deg, var(--dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: var(--spacing-4);
}

.hero h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-6);
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow:
        var(--shadow-2xl),
        inset 0 0 40px rgba(67, 97, 238, 0.1);
    animation: float 6s ease-in-out infinite;
}

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

/* ============================================
   SECTIONS
============================================ */
.section {
    padding: var(--spacing-20) 0;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-12);
}

.section-title h2 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--dark);
    display: inline-block;
    position: relative;
    padding-bottom: var(--spacing-3);
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
}

/* ============================================
   SKILLS
============================================ */
.skill-bar {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--gray-light);
    overflow: hidden;
    position: relative;
}

.skill-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(67, 97, 238, 0.1) 0%,
        rgba(76, 201, 240, 0.1) 100%
    );
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: -100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* ============================================
   CARDS - MODERN DESIGN
============================================ */
.experience-card,
.portfolio-item,
.contact-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    transition: all var(--transition-base);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.experience-card::before,
.portfolio-item::before,
.contact-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(67, 97, 238, 0.05) 0%,
        rgba(76, 201, 240, 0.05) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.experience-card:hover,
.portfolio-item:hover,
.contact-item:hover {
    transform: translateY(-8px);
    box-shadow:
        var(--shadow-2xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.experience-card:hover::before,
.portfolio-item:hover::before,
.contact-item:hover::before {
    opacity: 1;
}

.portfolio-item:hover {
    transform: translateY(-8px) rotateX(5deg);
}
.contact-item{
  margin-bottom: 5px;
}

.contact-item:hover {
    transform: translateX(-8px);
}

/* اضافه به static/css/main.css */

/* اعتبارسنجی فرم */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* پیام‌ها */
.alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-right: 4px solid #10b981;
}

.alert-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
    border-right: 4px solid #ef4444;
}

.alert ul {
    padding-right: 1.5rem;
    margin-bottom: 0;
}

.alert ul li {
    margin-bottom: 0.25rem;
}

/* حالت loading */
button.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Portfolio Image */
.portfolio-img {
    height: 200px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-item:hover .portfolio-img img {
    transform: scale(1.1) rotate(2deg);
}

/* ============================================
   FORMS - MODERN INPUTS
============================================ */
.form-control {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(67, 97, 238, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3) var(--spacing-4);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(67, 97, 238, 0.1),
        var(--shadow-md);
    transform: translateY(-2px);
}

.input-group-text {
    background: rgba(67, 97, 238, 0.1);
    border: 2px solid rgba(67, 97, 238, 0.1);
    border-left: none;
    color: var(--primary);
    transition: all var(--transition-base);
}

.input-group:focus-within .input-group-text {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   SOCIAL LINKS
============================================ */
.social-links a {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.social-links a:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-xl);
    color: white;
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a i {
    position: relative;
    z-index: 1;
}

/* Footer Social */
.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: all var(--transition-base);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* ============================================
   SCROLL TO TOP
============================================ */
.scroll-up {
    position: fixed;
    bottom: 30px;
    left: 30px; /* تغییر از right به left برای RTL */
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: var(--radius-full);
    display: flex !important; /* اضافه کردن !important */
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all var(--transition-base);
    z-index: 9999 !important; /* z-index بالا */
    box-shadow: var(--shadow-xl);
    border: none;
    overflow: hidden;
    outline: none;
    user-select: none;
}

/* مهم: کلاس show باید display را تغییر دهد */
.scroll-up.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    display: flex !important;
}

/* برای نمایش اولیه در دیباگ */
.scroll-up.debug {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    background: red !important; /* رنگ قرمز برای تشخیص */
}

/* Hover effects */
.scroll-up:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-2xl);
}

/* ============================================
   NOTIFICATIONS
============================================ */
.notification {
    position: fixed;
    top: var(--spacing-6);
    right: var(--spacing-6);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-4) var(--spacing-6);
    color: var(--dark);
    z-index: 9999;
    max-width: 400px;
    transform: translateX(150%);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow-2xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-right: 4px solid var(--success);
}

.notification.error {
    border-right: 4px solid var(--danger);
}

.notification.warning {
    border-right: 4px solid var(--warning);
}

.notification.info {
    border-right: 4px solid var(--info);
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1200px) {
    
    .hero h1 {
        font-size: var(--font-size-4xl);
    }

    .hero h2 {
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: var(--font-size-3xl);
    }

    .section-title h2 {
        font-size: var(--font-size-3xl);
    }

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

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
        --font-size-xl: 1.25rem;
    }
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        font-smooth: always;
    }
    
    /* تضمین لود فونت در موبایل */
    body::before {
        content: '';
        font-family: 'Vazirmatn';
        position: absolute;
        width: 0;
        height: 0;
        overflow: hidden;
        z-index: -1;
    }
    
    /* بهبود نمایش متن در موبایل */
    h1, h2, h3, h4, h5, h6,
    p, span, a, li, button, input, textarea {
        font-family: 'Vazirmatn';
    }
    .hero {
    margin-top: 0px;
}
    .hero h1 {
        font-size: var(--font-size-3xl);
    }

    .hero h2 {
        font-size: var(--font-size-lg);
    }

    .hero-image img {
        max-width: 280px;
    }

    .notification {
        right: var(--spacing-2);
        left: var(--spacing-2);
        max-width: none;
    }

    .scroll-up {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        bottom: 20px;
        left: 20px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: var(--font-size-2xl);
    }

    .hero h2 {
        font-size: var(--font-size-base);
    }

    .section-title h2 {
        font-size: var(--font-size-2xl);
    }

    .experience-card,
    .portfolio-item,
    .contact-item {
        padding: var(--spacing-4);
    }
}

@media (max-width: 480px) {
    .scroll-up {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
        bottom: 15px;
        left: 15px;
    }
}

/* ============================================
   UTILITY CLASSES
============================================ */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow:
        0 0 20px rgba(67, 97, 238, 0.2),
        var(--shadow-md);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Typing Animation */
.typing-text {
    display: inline-block;
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Mobile Toggle Button Animation */
.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2867, 97, 238, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Active Section Indicator */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 20%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4361ee, #4cc9f0);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link.active::before {
    width: 60%;
}

/* Loading Animation for Navbar */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mainNavbar {
    animation: fadeInDown 0.5s ease-out;
}

/* Navigation Item Animation Delay */
.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }

/* Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.3);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) scale(1.05);
    }
    80% {
        opacity: 0.9;
        transform: translateY(2px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulse animation برای جلب توجه */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
}

.scroll-up.pulse {
    animation: pulse 2s infinite;
}

/* Floating animation */
@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.scroll-up.floating {
    animation: floating 3s ease-in-out infinite;
}

/* Variables for responsive design */
@media (prefers-reduced-motion: reduce) {
    .scroll-up {
        transition: opacity 0.3s ease;
    }

    .scroll-up.show {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .scroll-up {
        --primary: #6366f1;
        --primary-dark: #4f46e5;
        --accent: #8b5cf6;
        --accent-light: #a78bfa;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
                    0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .scroll-up {
        border: 2px solid white;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .scroll-up {
        width: 60px;
        height: 60px;
        bottom: 2rem;
        right: 2rem;
    }

    .scroll-up:active {
        transform: scale(0.95);
    }

    .scroll-up:hover {
        transform: none;
    }
}

 @supports (-webkit-touch-callout: none) {
        body {
            -webkit-font-smoothing: subpixel-antialiased;
        }
        
        .hero h1,
        .section-title h2 {
            -webkit-background-clip: text !important;
            -webkit-text-fill-color: transparent;
            background-clip: text !important;
        }
    }
    
    /* تنظیمات خاص برای Chrome Android */
    @supports (not (-webkit-touch-callout: none)) {
        body {
            text-rendering: geometricPrecision;
        }
    }
}
