/* Reset & Base Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary-color: #7c3aed;
    --accent-color: #0ea5e9;
    --dark-color: #1e293b;
    --dark-light: #334155;
    --light-color: #f8fafc;
    --gray-color: #64748b;
    --gray-light: #cbd5e1;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

body.dark-theme {
    --dark-color: #f8fafc;
    --light-color: #1e293b;
    --gray-color: #94a3b8;
    --gray-light: #475569;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.dark-theme .header {
    background-color: rgba(30, 41, 59, 0.95);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
}

.dark-theme .logo {
    color: var(--light-color);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.dark-theme .nav-link {
    color: var(--light-color);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--gray-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: rotate(30deg);
}

.theme-toggle i {
    position: absolute;
    font-size: 1.25rem;
    transition: var(--transition);
}

.theme-toggle .fa-sun {
    opacity: 0;
    transform: scale(0);
}

.dark-theme .theme-toggle .fa-sun {
    opacity: 1;
    transform: scale(1);
}

.dark-theme .theme-toggle .fa-moon {
    opacity: 0;
    transform: scale(0);
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle .bar {
    width: 25px;
    height: 2px;
    background-color: var(--dark-color);
    border-radius: 1px;
    transition: var(--transition);
}

.dark-theme .menu-toggle .bar {
    background-color: var(--light-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.hero-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-title span {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--gray-color);
    margin-bottom: 2rem;
}

.typing-text {
    color: var(--primary-color);
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-color);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* Stats Section */
.stats {
    padding: 4rem 0;
    background-color: var(--light-color);
    border-top: 1px solid var(--gray-light);
    border-bottom: 1px solid var(--gray-light);
}

.dark-theme .stats {
    background-color: var(--dark-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.dark-theme .stat-card {
    background: var(--dark-light);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-email {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title span {
    color: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    padding: 6rem 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.dark-theme .service-card {
    background: var(--dark-light);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    color: white;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.service-description {
    color: var(--gray-color);
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 6rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
}

.profile-img {
    width: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.experience-badge span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.experience-badge small {
    font-size: 0.875rem;
    opacity: 0.9;
}

.about-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.about-name span {
    color: var(--primary-color);
}

.about-description {
    color: var(--gray-color);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-info {
    margin-bottom: 2rem;
}

.info-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--border-radius);
}

.dark-theme .info-item {
    background: rgba(37, 99, 235, 0.2);
}

.info-label {
    font-weight: 600;
}

.info-value {
    color: var(--primary-color);
    font-weight: 500;
}

/* Skills Section */
.skills {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.dark-theme .skills {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.dark-theme .skill-category {
    background: var(--dark-light);
}

.skill-category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 500;
}

.skill-percent {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease;
}

/* Experience & Education Grid */
.experience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.experience-column,
.education-column {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.dark-theme .experience-column,
.dark-theme .education-column {
    background: var(--dark-light);
}

.experience-title,
.education-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.experience-item,
.education-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.experience-item:last-child,
.education-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.experience-item-title,
.education-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.experience-item-desc,
.education-item-desc {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Education Subjects */
.education-subjects {
    padding: 6rem 0;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.subject-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.dark-theme .subject-card {
    background: var(--dark-light);
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.subject-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-icon img {
    max-width: 100%;
    height: auto;
}

.subject-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subject-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.dark-theme .contact {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

/* Contact Form */
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.dark-theme .contact-form {
    background: var(--dark-light);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.form-description {
    color: var(--gray-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.dark-theme .form-group input,
.dark-theme .form-group textarea {
    background: var(--dark-color);
    border-color: var(--gray-color);
    color: var(--light-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

#form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
}

#form-message.success {
    background: #10b981;
    color: white;
}

#form-message.error {
    background: #ef4444;
    color: white;
}

/* Contact Info */
.contact-info {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.dark-theme .contact-info {
    background: var(--dark-light);
}

.info-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.info-description {
    color: var(--gray-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-items {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.info-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-content p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.dark-theme .social-link {
    background: var(--gray-color);
    color: var(--light-color);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 4rem 0 2rem;
}

.dark-theme .footer {
    background: #0f172a;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.footer-logo img {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
}

.logo-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.logo-text p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-nav h4,
.footer-contact h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 0.75rem;
}

.footer-nav a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: white;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-contact i {
    width: 20px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #334155;
    text-align: center;
}

.copyright {
    color: #94a3b8;
    font-size: 0.9rem;
}

.copyright strong {
    color: var(--primary-light);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .experience-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header */
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition-slow);
    }
    
    .dark-theme .nav-menu {
        background: var(--dark-color);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .services-grid,
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}