/*
Theme Name: GF Certificate Theme Pro
Theme URI: https://example.com/gf-cert-theme
Author: Your Name
Author URI: https://example.com
Description: قالب حرفه‌ای و مدرن برای نمایش گواهی‌نامه‌ها و فرم‌های Gravity Forms - با پشتیبانی از Glassmorphism، Neumorphism و انیمیشن‌های پیشرفته
Version: 2.1.0
License: GPL v2 or later
Text Domain: gf-cert-theme-pro
Domain Path: /languages
Tags: certificate, gravity-forms, responsive, glassmorphism, modern, rtl
*/

/* ==================== CSS Variables - بهینه شده ==================== */
:root {
    /* رنگ‌های اصلی */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f39c12;
    
    /* رنگ‌های متن و پس‌زمینه */
    --text-color: #333333;
    --text-muted: #666666;
    --heading-color: #222222;
    --background-color: #f8f9fa;
    --light-bg: #ffffff;
    --border-color: #e0e0e0;
    
    /* رنگ‌های دکمه */
    --button-bg: #667eea;
    --button-text: #ffffff;
    --button-hover-bg: #764ba2;
    --button-hover-text: #ffffff;
    
    /* ابعاد */
    --container-width: min(1200px, 95vw);
    --section-spacing: clamp(40px, 8vw, 80px);
    --base-font-size: clamp(14px, 2vw, 16px);
    
    /* تایپوگرافی */
    --body-font: 'Vazir', 'Tahoma', 'Segoe UI', sans-serif;
    --heading-font: 'Vazir', 'Tahoma', 'Segoe UI', sans-serif;
    
    /* هدر و فوتر */
    --header-bg: #667eea;
    --header-text: #ffffff;
    --footer-bg: #764ba2;
    
    /* منو */
    --menu-align: center;
    --menu-spacing: clamp(15px, 2vw, 25px);
    --menu-size: clamp(13px, 1.5vw, 15px);
    
    /* دکمه‌ها */
    --btn-radius: 50px;
    --btn-pad-y: clamp(10px, 2vw, 14px);
    --btn-pad-x: clamp(20px, 4vw, 35px);
    --btn-shadow: 0 4px 15px rgba(0,0,0,0.12);
    
    /* کارت‌ها */
    --cert-radius: clamp(12px, 2vw, 20px);
    --card-padding: clamp(20px, 4vw, 40px);
    
    /* انیمیشن‌ها */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* سایه‌ها */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(102,126,234,0.25);
    
    /* z-index */
    --z-header: 1000;
    --z-modal: 2000;
    --z-tooltip: 3000;
}

/* ==================== Reset & Base - بهینه ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: var(--base-font-size);
}

body {
    font-family: var(--body-font);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--secondary-color);
}

/* ==================== Layout - کاملاً رسپانسیو ==================== */
.container {
    width: min(100% - 2rem, var(--container-width));
    margin-inline: auto;
    padding-inline: clamp(10px, 3vw, 20px);
}

.site-content {
    padding-block: var(--section-spacing);
    min-height: calc(100svh - 300px);
}

/* ==================== Typography - مقیاس‌پذیر ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--heading-color);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(0.9rem, 1.5vw, 1rem); }

p {
    margin-bottom: 1rem;
    text-wrap: pretty;
}

/* ==================== Header - مدرن و رسپانسیو ==================== */
.site-header {
    position: relative;
    z-index: var(--z-header);
    background: linear-gradient(135deg, var(--header-bg) 0%, var(--secondary-color) 100%);
    color: var(--header-text);
    box-shadow: var(--shadow-md);
    isolation: isolate;
}

.site-header a {
    color: var(--header-text);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(10px, 2vw, 15px) 0;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
}

/* Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
    flex-shrink: 0;
}

.site-logo img {
    max-height: clamp(40px, 8vw, 50px);
    width: auto;
    transition: var(--transition-fast);
}

.site-logo img:hover {
    transform: scale(1.05) rotate(2deg);
}

.site-title {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin: 0;
    font-weight: 700;
}

.site-description {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    opacity: 0.9;
    margin: 0;
}

/* ==================== Navigation - بهینه برای موبایل ==================== */
.main-navigation {
    flex: 1;
    order: 2;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: var(--menu-spacing);
    justify-content: var(--menu-align);
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 16px);
    font-size: var(--menu-size);
    font-weight: 500;
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    transition: var(--transition-base);
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current_page_item > a {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Dropdown - بهبود یافته */
.has-dropdown {
    position: relative;
}

.dropdown-icon {
    transition: var(--transition-fast);
    font-size: 0.8em;
}

.has-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--light-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease;
    z-index: calc(var(--z-header) + 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.has-dropdown:hover > .dropdown-menu,
.has-dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-color);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: rgba(102,126,234,0.08);
    color: var(--primary-color);
    padding-right: 20px;
}

/* ==================== Header Elements - بهینه ==================== */
.header-elements {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    flex-shrink: 0;
    order: 3;
}

/* Search - مدرن */
.header-search {
    position: relative;
}

.search-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--header-text);
    width: clamp(36px, 6vw, 40px);
    height: clamp(36px, 6vw, 40px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.search-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1) rotate(5deg);
}

.search-popup {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    width: min(320px, 90vw);
    background: var(--light-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease;
    z-index: calc(var(--z-header) + 2);
    border: 1px solid rgba(0,0,0,0.05);
}

.header-search.active .search-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-field {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--background-color);
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.search-submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.search-submit:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Login */
.header-login {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu {
    position: relative;
}

.user-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--header-text);
    width: clamp(36px, 6vw, 40px);
    height: clamp(36px, 6vw, 40px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    background: var(--light-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: calc(var(--z-header) + 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: rgba(102,126,234,0.08);
    color: var(--primary-color);
}

/* ==================== Buttons - زیباتر ==================== */
.btn, .button, button[type="submit"], input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--button-bg);
    color: var(--button-text);
    padding: var(--btn-pad-y) var(--btn-pad-x);
    border: none;
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--btn-shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--header-text);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.2);
    border-color: #fff;
}

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

.btn-accent:hover {
    background: #e67e22;
}

.btn-glow {
    box-shadow: 0 0 20px rgba(243,156,18,0.4);
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(243,156,18,0.6);
}

/* ==================== Cards - مدرن‌تر ==================== */
.card {
    background: var(--light-bg);
    border-radius: var(--cert-radius);
    padding: var(--card-padding);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 100%;
    transform: scaleX(0);
    transition: var(--transition-base);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

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

/* Card Hover Effects */
.hover-lift .card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.hover-scale .card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.hover-glow .card:hover {
    box-shadow: var(--shadow-glow);
}

.hover-border .card {
    border: 2px solid transparent;
}

.hover-border .card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

/* Card Styles */
.style-gradient {
    background: linear-gradient(135deg, rgba(102,126,234,0.05) 0%, rgba(118,75,162,0.05) 100%);
}

.style-glass {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
}

.style-neumorph {
    background: var(--background-color);
    box-shadow: 
        8px 8px 16px rgba(0,0,0,0.06),
        -8px -8px 16px rgba(255,255,255,0.9);
    border: none;
}

.style-neumorph:hover {
    box-shadow: 
        12px 12px 24px rgba(0,0,0,0.08),
        -12px -12px 24px rgba(255,255,255,1);
}

/* ==================== Hero Section - خیره‌کننده ==================== */
.hero-section {
    position: relative;
    padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 40px);
    text-align: center;
    color: #fff;
    overflow: hidden;
    border-radius: var(--cert-radius);
    margin-bottom: 40px;
    isolation: isolate;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 30px 30px;
    animation: heroPattern 20s linear infinite;
    z-index: 0;
}

@keyframes heroPattern {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 30px) rotate(5deg); }
}

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

.hero-section h1 {
    font-size: clamp(1.75rem, 6vw, 3.5rem);
    margin-bottom: clamp(15px, 3vw, 25px);
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease;
}

.hero-section p {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    margin-bottom: clamp(25px, 5vw, 40px);
    opacity: 0.95;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-section .btn {
    background: #fff;
    color: var(--primary-color);
    font-size: clamp(1rem, 2vw, 1.1rem);
    padding: clamp(12px, 3vw, 18px) clamp(30px, 6vw, 50px);
    animation: fadeInUp 0.8s ease 0.4s backwards;
    position: relative;
    z-index: 1;
}

.hero-section .btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Floating Elements */
.hero-float {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-float-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.hero-float-2 {
    width: 200px;
    height: 200px;
    background: #fff;
    bottom: -50px;
    left: -50px;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -30px) scale(1.1); }
}

/* ==================== Forms (Gravity Forms) - بهبود یافته ==================== */
.gform_wrapper {
    background: var(--light-bg);
    padding: clamp(20px, 5vw, 40px);
    border-radius: var(--cert-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.03);
}

.gform_wrapper .gfield_label {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
}

.gform_wrapper input:not([type="submit"]),
.gform_wrapper textarea,
.gform_wrapper select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
    background: #fff;
}

.gform_wrapper input:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.gform_wrapper .gform_button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.gform_wrapper .gform_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

/* ==================== Certificate Tracker - مدرن ==================== */
.gf-cert-tracker-container {
    background: var(--light-bg);
    border-radius: var(--cert-radius);
    padding: clamp(25px, 5vw, 50px);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.03);
}

.tracker-header {
    text-align: center;
    margin-bottom: clamp(20px, 4vw, 35px);
}

.tracker-header h3 {
    color: var(--heading-color);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 10px;
}

.tracker-form {
    display: flex;
    gap: clamp(10px, 2vw, 15px);
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.tracker-input {
    flex: 1;
    min-width: 200px;
    padding: clamp(12px, 3vw, 18px) clamp(20px, 4vw, 30px);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--background-color);
}

.tracker-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.tracker-submit {
    padding: clamp(12px, 3vw, 18px) clamp(25px, 5vw, 40px);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tracker-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.tracker-results {
    margin-top: clamp(20px, 4vw, 35px);
    overflow-x: auto;
}

.tracker-results table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.tracker-results th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: clamp(12px, 2vw, 18px);
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.tracker-results th:first-child {
    border-radius: 0 12px 0 0;
}

.tracker-results th:last-child {
    border-radius: 12px 0 0 0;
}

.tracker-results td {
    padding: clamp(10px, 2vw, 16px);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.95rem;
}

.tracker-results tr:hover td {
    background: rgba(102,126,234,0.03);
}

.btn-view, .btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 2px;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-view {
    background: rgba(102,126,234,0.1);
    color: var(--primary-color);
}

.btn-view:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.btn-download {
    background: rgba(46,204,113,0.1);
    color: #27ae60;
}

.btn-download:hover {
    background: #27ae60;
    color: #fff;
    transform: translateY(-2px);
}

/* ==================== Footer - زیبا و رسپانسیو ==================== */
.site-footer {
    background: linear-gradient(135deg, var(--footer-bg) 0%, var(--primary-color) 100%);
    color: #fff;
    padding-top: clamp(40px, 8vw, 70px);
    margin-top: clamp(40px, 8vw, 80px);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color), var(--secondary-color));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

/* Footer Widgets Area */
.footer-widgets-area {
    padding-bottom: clamp(30px, 5vw, 50px);
    position: relative;
    z-index: 1;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(20px, 4vw, 40px);
}

/* پشتیبانی هوشمند از تعداد ستون‌های مختلف */
.footer-widgets-grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(4, 1fr);
}

.footer-widgets-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

.footer-widgets-grid:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

.footer-widgets-grid:has(> :only-child) {
    grid-template-columns: 1fr;
}

.footer-widget-column {
    padding: 0;
}

.footer-widget {
    margin-bottom: 0;
}

.footer-widget .widget-title {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    margin-bottom: clamp(15px, 3vw, 25px);
    color: #fff;
    position: relative;
    padding-bottom: 12px;
    font-weight: 700;
}

.footer-widget .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.footer-widget:hover .widget-title::after {
    width: 60px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget ul li a {
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.footer-widget ul li a::before {
    content: '←';
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-fast);
    font-size: 0.8em;
}

.footer-widget ul li a:hover {
    color: #fff;
    padding-right: 10px;
}

.footer-widget ul li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Footer Bottom */
.footer-bottom-area {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: clamp(20px, 3vw, 30px) 0;
    position: relative;
    z-index: 1;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    opacity: 0.9;
    text-align: center;
}

.footer-bottom-widgets {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ==================== Pagination - مدرن ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: clamp(30px, 5vw, 50px) 0;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    padding: 0 clamp(12px, 2vw, 18px);
    border-radius: 12px;
    background: var(--light-bg);
    color: var(--text-color);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.page-numbers:hover,
.page-numbers.current {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    transform: translateY(-3px);
    border-color: transparent;
}

/* ==================== Sticky Header - بهبود یافته ==================== */
.header-sticky .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: slideDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    background: rgba(102,126,234,0.95);
}

.header-sticky .site-content {
    padding-top: calc(var(--section-spacing) + 80px);
}

.admin-bar.header-sticky .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar.header-sticky .site-header {
        top: 46px;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-hidden {
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Header Variants - بهینه ==================== */
/* Glass */
.header-glass {
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.header-glass .glass-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

/* Modern */
.header-modern {
    overflow: hidden;
}

.header-modern .header-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 12s ease-in-out infinite;
}

/* Centered */
.header-centered {
    text-align: center;
}

.header-centered .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header-centered .site-branding {
    flex-direction: column;
}

.header-centered .main-navigation {
    width: 100%;
}

.header-centered .nav-menu {
    justify-content: center;
}

/* ==================== Mobile Menu - کاملاً بازطراحی ==================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: clamp(44px, 10vw, 50px);
    height: clamp(44px, 10vw, 50px);
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 10px;
    gap: 6px;
    order: 1;
    transition: var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--header-text);
    border-radius: 2px;
    transition: var(--transition-fast);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* ==================== Animations - بهینه ==================== */
.animations-enabled .card {
    animation: fadeInUp 0.6s ease backwards;
}

.animations-enabled .card:nth-child(1) { animation-delay: 0.1s; }
.animations-enabled .card:nth-child(2) { animation-delay: 0.2s; }
.animations-enabled .card:nth-child(3) { animation-delay: 0.3s; }
.animations-enabled .card:nth-child(4) { animation-delay: 0.4s; }

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

/* ==================== Particles - بهینه ==================== */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.2;
    animation: particleFloat 20s infinite linear;
    filter: blur(1px);
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg) scale(1);
        opacity: 0;
    }
}

/* ==================== Widgets - یکپارچه ==================== */
/* Site Stats */
.site-stats-widget {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(12px, 2vw, 20px);
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    transition: var(--transition-fast);
}

.stat-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px);
}

.stat-number {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* Contact Info */
.contact-info-widget .contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
}

.contact-info-widget svg {
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.8;
}

/* Social Links */
.social-links-widget {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-link:hover {
    background: var(--accent-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(243,156,18,0.3);
}

/* Newsletter */
.newsletter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-family: inherit;
    transition: var(--transition-fast);
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.newsletter-form .btn {
    width: 100%;
}

/* Certificates List */
.certificates-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.certificates-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition-fast);
}

.certificates-list li:hover {
    border-color: rgba(255,255,255,0.2);
    padding-right: 5px;
}

.certificates-list li:last-child {
    border-bottom: none;
}

.certificates-list a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(255,255,255,0.9);
}

.certificates-list .cert-title {
    font-weight: 500;
    transition: var(--transition-fast);
}

.certificates-list a:hover .cert-title {
    color: #fff;
}

.certificates-list .cert-date {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ==================== Responsive - کامل و بهینه ==================== */
@media (max-width: 1024px) {
    .footer-widgets-grid:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
    }
    
    .site-branding {
        flex: 1;
        min-width: 0;
    }
    
    .site-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: var(--light-bg);
        box-shadow: var(--shadow-lg);
        padding: 80px 20px 20px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: calc(var(--z-header) - 1);
        overflow-y: auto;
    }
    
    .main-navigation.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .nav-menu > li > a {
        width: 100%;
        justify-content: space-between;
        background: rgba(102,126,234,0.05);
        color: var(--text-color);
        border-radius: 12px;
    }
    
    .nav-menu > li > a:hover {
        background: rgba(102,126,234,0.1);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        display: none;
        padding: 5px 10px;
        margin-top: 5px;
    }
    
    .has-dropdown.active > .dropdown-menu {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    .dropdown-menu li a {
        color: var(--text-muted);
        padding: 10px 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-fast);
        z-index: calc(var(--z-header) - 2);
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .header-elements {
        gap: 8px;
    }
    
    .search-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: min(90vw, 400px);
    }
    
    .header-search.active .search-popup {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .footer-widgets-grid,
    .footer-widgets-grid:has(> :nth-child(4):last-child),
    .footer-widgets-grid:has(> :nth-child(3):last-child) {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .tracker-form {
        flex-direction: column;
    }
    
    .tracker-submit {
        width: 100%;
    }
    
    .site-stats-widget {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    :root {
        --section-spacing: 30px;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .site-description {
        display: none;
    }
    
    .header-elements {
        gap: 6px;
    }
    
    .search-toggle,
    .user-toggle {
        width: 36px;
        height: 36px;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero-section {
        padding: 40px 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .gform_wrapper {
        padding: 20px 15px;
    }
}

/* ==================== Accessibility ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus Visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Screen Reader */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0056b3;
        --secondary-color: #003d80;
        --text-color: #000000;
    }
    
    .card,
    .gform_wrapper,
    .gf-cert-tracker-container {
        border: 2px solid currentColor;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu-toggle,
    .particles-container {
        display: none !important;
    }
    
    .site-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* ==================== Footer Slider - پایدار ==================== */
.footer-slider-wrapper {
    position: relative;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-slider-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}


/* ==================== Footer Slider - لوگوها در یک ردیف ==================== */
.footer-slider-content {
    display: flex;
    flex-wrap: nowrap;               /* هرگز به خط بعد نمی‌روند */
    gap: 8px;                        /* فاصله کم بین لوگوها */
    justify-content: flex-start;     /* راست‌چین (لوگوها از سمت راست) */
    align-items: center;             /* تراز عمودی */
    padding: 20px 25px 20px 20px;    /* padding-right بیشتر برای فاصله از لبه */
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.05);
    overflow-x: auto;
}

.footer-slider-content img {
    max-height: 60px;
    width: auto;
    display: block;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.footer-slider-content img:hover {
    transform: scale(1.05);
}

/* برای موبایل */
@media (max-width: 768px) {
    .footer-slider-content {
        gap: 6px;
        padding: 12px 15px 12px 10px;
        justify-content: flex-start;
    }
    .footer-slider-content img {
        max-height: 40px;
    }
}