:root {
    --primary: #10b981; /* سبز اصلی */
    --primary-dark: #059669; /* سبز تیره‌تر */
    --secondary: #1e293b;
    --accent: #34d399; /* سبز روشن برای کنتراست */
    --light: #f8fafc;
    --gray: #64748b;
    --dark: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 25px 30px -12px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s ease;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --text-color: #1e293b;
    --header-bg: #ffffff;
    --footer-bg: #0f172a;
}

[data-theme="dark"] {
    --primary: #34d399; /* سبز روشن برای حالت تاریک */
    --primary-dark: #10b981;
    --secondary: #f1f5f9;
    --accent: #6ee7b7; /* سبز بسیار روشن */
    --light: #0f172a;
    --gray: #94a3b8;
    --dark: #f8fafc;
    --card-bg: #1e293b;
    --body-bg: #0f172a;
    --text-color: #f1f5f9;
    --header-bg: #1e293b;
    --footer-bg: #020617;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: var(--header-bg);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

/* جدا کردن نام و نام خانوادگی در لوگو */
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-first {
    color: var(--primary);
}

.logo-last {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    bottom: -5px;
    right: 0;
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.admin-link {
    background: var(--accent);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.admin-link:hover {
    background: var(--primary);
}

.theme-toggle, .lang-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.theme-toggle:hover, .lang-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: rotate(15deg);
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .lang-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* دکمه زبان - فقط آیکون (بدون متن) */
.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-text {
    display: none; /* مخفی کردن کامل متن */
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Hero Section */
.hero {
    padding: 10rem 0 5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%); /* سبز تیره برای حالت دارک */
}

.hero::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.1;
    top: -100px;
    left: -100px;
}

.hero::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.1;
    bottom: -50px;
    right: -50px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid var(--card-bg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.hero h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 600px;
}

.highlight {
    background: linear-gradient(120deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* نام‌ها در بخش hero */
.name-parts {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.name-parts .highlight {
    background: linear-gradient(120deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

.btn:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    margin-left: 1rem;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Sections */
section {
    padding: 5rem 0;
    transition: var(--transition);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--secondary);
    display: inline-block;
    position: relative;
    padding-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 4px;
    background: var(--primary);
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateY(-5px);
}

.info-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.skill-tag {
    display: inline-block;
    background-color: rgba(16, 185, 129, 0.1); /* سبز با opacity */
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.3rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
}

.skill-tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Skills Section */
.skills {
    background-color: rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

[data-theme="dark"] .skills {
    background-color: rgba(255, 255, 255, 0.02);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.skill-item {
    margin-bottom: 2rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

[data-theme="dark"] .skill-bar {
    background: rgba(255, 255, 255, 0.1);
}

.skill-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 1.5s ease;
}

/* ========== Portfolio Section با تصویر ========== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-item {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 30px -12px rgba(0, 0, 0, 0.25);
}

/* تصویر با افکت هاور */
.portfolio-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.08);
}

/* اوورلی روی تصویر */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.portfolio-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-overlay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); /* سایه سبز */
    text-decoration: none;
}

.btn-overlay:hover {
    background: white;
    color: var(--primary);
    transform: rotate(360deg) scale(1.1);
}

/* محتوای پایین کارت */
.portfolio-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

.portfolio-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 0.75rem;
}

.portfolio-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to left, var(--primary), var(--accent));
    border-radius: 2px;
}

.project-desc {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    flex: 1;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.tag {
    background: rgba(16, 185, 129, 0.08); /* سبز با opacity */
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(16, 185, 129, 0.1); /* سبز با opacity */
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary);
}

.portfolio-actions {
    margin-top: 0.5rem;
}

.btn-small {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-small:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -5px rgba(16, 185, 129, 0.4); /* سایه سبز */
}

/* Contact Section */
.contact {
    background: #1e293b;
    color: #f8fafc;
    transition: var(--transition);
}

[data-theme="dark"] .contact {
    background: #065f46; /* سبز تیره برای حالت دارک */
}

.contact .section-title h2 {
    color: #f8fafc;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.contact-item i {
    color: var(--accent);
    font-size: 1.5rem;
}

.contact-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #f8fafc;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #f8fafc;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Messages */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    text-align: center;
}

.message.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: white;
    padding: 3rem 0;
    text-align: center;
    transition: var(--transition);
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.footer-logo .logo-first {
    color: var(--primary);
}

.footer-logo .logo-last {
    color: var(--accent);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-5px);
}

.copyright {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Language Styles */
[lang="en"] {
    direction: ltr;
    text-align: left;
}

[lang="en"] .hero-content {
    flex-direction: row-reverse;
}

[lang="en"] .hero h1,
[lang="en"] .hero h2,
[lang="en"] .hero p,
[lang="en"] .section-title h2,
[lang="en"] .about-text p,
[lang="en"] .portfolio-content h3,
[lang="en"] .portfolio-content p {
    text-align: left;
}

[lang="en"] .nav-links a::after {
    right: auto;
    left: 0;
}

[lang="en"] .section-title h2::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

[lang="en"] .btn-outline {
    margin-left: 0;
    margin-right: 1rem;
}

[lang="en"] .contact-item:hover {
    transform: translateX(-5px);
}

[lang="en"] .hero h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

[lang="en"] .hero h1 .name-parts {
    flex-direction: row-reverse;
}

[lang="en"] .logo {
    flex-direction: row-reverse;
}

[lang="en"] .portfolio-content h3::after {
    right: auto;
    left: 0;
}

/* Dark Mode برای بخش نمونه کارها */
[data-theme="dark"] .portfolio-image-wrapper {
    background: linear-gradient(45deg, #1e293b, #0f172a);
}

[data-theme="dark"] .tag {
    background: rgba(52, 211, 153, 0.1); /* سبز روشن با opacity */
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--primary);
}

[data-theme="dark"] .tag:hover {
    background: var(--primary);
    color: #0f172a;
}

[data-theme="dark"] .btn-small {
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .btn-small:hover {
    background: var(--primary);
    color: #0f172a;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }
    
    .about-content, .skills-container, .contact-container {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    [lang="en"] .hero-content {
        flex-direction: column;
    }
    
    [lang="en"] .hero h1, 
    [lang="en"] .hero h2, 
    [lang="en"] .hero p {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background: var(--header-bg);
        width: 100%;
        text-align: center;
        padding: 2rem 0;
        box-shadow: var(--shadow);
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .btn, .btn-outline {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        text-align: center;
    }
    
    .btn-outline {
        margin-left: 0;
    }
    
    .portfolio-image-wrapper {
        height: 200px;
    }
    
    .portfolio-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .about-info {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 8rem 0 3rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    
    .profile-img {
        width: 250px;
        height: 250px;
    }
    
    .portfolio-image-wrapper {
        height: 180px;
    }
    
    .portfolio-content {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .portfolio-image-wrapper {
        height: 160px;
    }
    
    .overlay-content h4 {
        font-size: 1rem;
    }
    
    .btn-overlay {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}