/* Reset و تنظیمات اولیه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563eb;
    --light-blue: #3b82f6;
    --dark-blue: #1d4ed8;
    --white: #ffffff;
    --off-white: #f8fafc;
    --gray: #64748b;
    --dark-gray: #334155;
    --light-gray: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--off-white);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* هدر */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0; /* کاهش ارتفاع هدر */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: relative;
}

/* لوگو کوچک‌تر */
.logo {
    font-size: 1.1rem; /* کاهش سایز لوگو */
    font-weight: 800;
    z-index: 1001;
}

.logo-text {
    color: var(--primary-blue);
}

/* منوی اصلی (دسکتاپ) */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-blue);
    background-color: rgba(37, 99, 235, 0.1);
}

.hire-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: white;
    border: none;
    padding: 0.7rem 1.3rem; /* کاهش سایز دکمه */
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem; /* کاهش سایز فونت */
}

.hire-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* منوی همبرگری */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--dark-gray);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* منوی موبایل */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 80px 2rem 2rem;
    transition: right 0.4s ease;
    z-index: 1000;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-menu a {
    display: block;
    text-decoration: none;
    color: var(--dark-gray);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.mobile-nav-menu a:hover {
    color: var(--primary-blue);
    background-color: rgba(37, 99, 235, 0.1);
}

.mobile-hire-btn {
    margin-top: 2rem;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* هیرو */
.hero {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
    min-width: 300px;
}

.greeting {
    color: var(--gray);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.name {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.name .highlight {
    color: var(--primary-blue);
}

.title {
    font-size: 1.75rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.typewriter {
    color: var(--primary-blue);
    position: relative;
}

.typewriter::after {
    content: '|';
    position: absolute;
    right: -8px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.description {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 500px;
}

.description strong {
    color: var(--dark-blue);
    font-weight: 600;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Vazirmatn', sans-serif;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

/* فریم عکس */
.hero-image {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.image-frame {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.image-frame img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 8px solid white;
    position: relative;
    z-index: 2;
}

.code-bg {
    position: absolute;
    bottom: -30px;
    left: -30px;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1;
    max-width: 280px;
    border: 1px solid var(--light-gray);
}

.code-bg pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    direction: ltr;
}

/* بخش‌های عمومی */
section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--dark-gray);
}

.section-title span {
    color: var(--primary-blue);
}

/* درباره من */
.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.tech-stack {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tech-tag {
    background: #dbeafe;
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.tech-tag:hover {
    transform: translateY(-2px);
}

.about-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 250px;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat i {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.stat h3 {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* مهارت‌ها */
.skills {
    background-color: var(--off-white);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease;
    border: 1px solid var(--light-gray);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.skill-category h3 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.skill-category h3 i {
    font-size: 1.25rem;
}

.skill {
    margin-bottom: 1.5rem;
}

.skill:last-child {
    margin-bottom: 0;
}

.skill span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.progress-bar {
    height: 10px;
    background: var(--light-gray);
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--light-blue), var(--primary-blue));
    border-radius: 5px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* پروژه‌ها */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid var(--light-gray);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.project-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.project-tags span {
    background: #dbeafe;
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ارتباط */
.contact-content {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-description {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.social-link:hover {
    transform: translateX(-5px);
    background: #eff6ff;
}

.social-link.telegram {
    border-right-color: #229ED9;
}

.social-link.instagram {
    border-right-color: #E4405F;
}

.social-link.github {
    border-right-color: #181717;
}

.social-link.email {
    border-right-color: #EA4335;
}

.social-link i {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.social-title {
    display: block;
    font-weight: 600;
    color: var(--dark-gray);
}

.social-username {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
}

.contact-form {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* فوتر */
.footer {
    background: var(--dark-blue);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer p {
    margin: 0;
}

.footer i {
    color: #fca5a5;
    margin: 0 0.25rem;
}

.footer-quote {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* رسپانسیو */
@media (max-width: 992px) {
    .hamburger-menu {
        display: flex;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hire-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .image-frame {
        max-width: 300px;
    }
    
    .code-bg {
        position: relative;
        bottom: 0;
        left: 0;
        margin-top: -20px;
        margin-left: auto;
        margin-right: auto;
        max-width: 250px;
    }
    
    .about-content,
    .contact-content {
        flex-direction: column;
        padding: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }
    
    .name {
        font-size: 2rem;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .logo {
        font-size: 1rem;
    }
}