/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Dark Color Palette */
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* Dark Neutral Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-dark: #020617;
    --border-color: #334155;
    --border-light: #475569;

    /* Enhanced Shadows for Dark Theme */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Glassmorphism for Dark Theme */
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(139, 92, 246, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);

    /* Dark Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --gradient-glow: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #f59e0b 100%);

    /* Animations */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all var(--transition-normal);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Enhanced Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Modern Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.nav-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    position: relative;
}

.nav-logo .logo-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.nav-logo .logo-text:hover::after {
    transform: scaleX(1);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    border-radius: 0.5rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-normal);
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
    transform: scale(1);
}

.nav-link:hover,
.nav-link.active {
    color: white;
    transform: translateY(-2px);
}

.nav-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switch {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.language-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.language-switch:hover::before {
    left: 100%;
}

.language-switch:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-normal);
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    transform: rotate(90deg);
}

/* Enhanced Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.title-main {
    color: rgba(255, 255, 255, 0.9);
    display: block;
    animation: slideInLeft 1s var(--transition-smooth);
}

.title-name {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    animation: slideInRight 1s var(--transition-smooth) 0.3s both;
    position: relative;
}

.title-name::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    border-radius: 2px;
    transform: scaleX(0);
    animation: expandWidth 1s var(--transition-smooth) 0.6s forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes expandWidth {
    to {
        transform: scaleX(1);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-weight: 600;
    animation: fadeInUp 1s var(--transition-smooth) 0.6s both;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
    animation: fadeInUp 1s var(--transition-smooth) 0.9s both;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s var(--transition-smooth) 1.2s both;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 2rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

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

.btn-primary {
    background: var(--gradient-secondary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.profile-image {
    text-align: center;
    animation: float 6s ease-in-out infinite;
}

.profile-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-2xl);
    transition: all var(--transition-normal);
    position: relative;
}

.profile-image img::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--gradient-glow);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.profile-image img:hover {
    transform: scale(1.05) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 50px rgba(240, 147, 251, 0.5);
}

/* Enhanced Section Styles */
section {
    padding: 5rem 0;
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--gradient-secondary);
    border-radius: 1px;
}

/* Enhanced About Section */
.about-section {
    background: var(--bg-primary);
    position: relative;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(99,102,241,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.5;
}

.about-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Enhanced Projects Section */
.projects-section {
    background: var(--gradient-dark);
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.projects-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>');
    opacity: 0.3;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.projects-section .section-title {
    color: white;
}

.projects-section .section-title::after {
    background: white;
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.filter-btn {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 3rem;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-normal);
    color: white;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

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

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.project-card {
    background: rgba(30, 41, 59, 0.95);
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-20px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Enhanced Project Gallery */
.project-gallery {
    position: relative;
    overflow: hidden;
}

.project-main-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-normal);
    filter: brightness(0.9);
}

.project-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.project-thumbnail {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    opacity: 0.7;
}

.project-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.project-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.image-counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-card:hover .project-image {
    filter: brightness(1.1);
    transform: scale(1.1);
}

.project-content {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-tag {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: none;
}

.project-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    flex: 1;
    text-align: center;
    padding: 1rem;
    text-decoration: none;
    border-radius: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.project-link:hover::before {
    left: 100%;
}

.project-link.demo {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.project-link.demo:hover {
    background: var(--gradient-secondary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.project-link.github {
    background: var(--glass-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    backdrop-filter: blur(20px);
}

.project-link.github:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* Enhanced Skills Section */
.skills-section {
    background: var(--bg-primary);
    position: relative;
}

.skills-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hexagons" width="50" height="50" patternUnits="userSpaceOnUse"><polygon points="25,0 50,14.4 50,35.6 25,50 0,35.6 0,14.4" fill="none" stroke="rgba(99,102,241,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23hexagons)"/></svg>');
    opacity: 0.3;
}

.skills-categories {
    display: grid;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-item:hover {
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.skill-item i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    transition: all var(--transition-normal);
}

.skill-item:hover i {
    color: white;
    transform: scale(1.2) rotate(10deg);
}

.skill-item span {
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-normal);
}

/* Enhanced Education Section */
.education-section {
    background: var(--gradient-secondary);
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.education-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="circles" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23circles)"/></svg>');
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
}

.education-section .section-title {
    color: white;
}

.education-section .section-title::after {
    background: white;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.education-item {
    background: rgba(30, 41, 59, 0.95);
    border-radius: 2rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    position: relative;
}

.education-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.education-item:hover::before {
    opacity: 1;
}

.education-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(255, 255, 255, 0.4);
}

.education-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.education-item:hover .education-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-xl);
}

.education-content h3 {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.education-institution {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.education-period {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Enhanced Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 1.5rem;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.contact-item:hover::before {
    transform: scaleY(1);
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.contact-item i {
    font-size: 1.75rem;
    color: var(--primary-color);
    width: 50px;
    text-align: center;
    transition: all var(--transition-normal);
}

.contact-item:hover i {
    transform: scale(1.2) rotate(10deg);
}

.contact-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.contact-item p {
    color: var(--text-secondary);
}

.contact-link {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
}

.contact-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.contact-link:hover p {
    color: var(--primary-color);
}

.contact-form {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.contact-form:hover::before {
    transform: scaleX(1);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group label {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    pointer-events: none;
    background: var(--bg-tertiary);
    padding: 0 0.5rem;
}

.form-group input:focus+label,
.form-group textarea:focus+label,
.form-group input:not(:placeholder-shown)+label,
.form-group textarea:not(:placeholder-shown)+label {
    top: -0.5rem;
    right: 0.75rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Enhanced Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-pattern" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-pattern)"/></svg>');
    opacity: 0.5;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    background: var(--gradient-secondary);
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-thumbnails {
        justify-content: center;
        padding: 0.75rem;
    }

    .project-thumbnail {
        width: 50px;
        height: 35px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .education-grid {
        grid-template-columns: 1fr;
    }

    .education-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .project-filters {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-container {
        padding: 1rem;
    }

    .hero-container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Enhanced RTL Specific Adjustments */
[dir="rtl"] .nav-link.active::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .contact-item:hover {
    transform: translateX(-10px);
}

[dir="rtl"] .form-group label {
    right: auto;
    left: 1.25rem;
}

[dir="rtl"] .form-group input:focus+label,
[dir="rtl"] .form-group textarea:focus+label,
[dir="rtl"] .form-group input:not(:placeholder-shown)+label,
[dir="rtl"] .form-group textarea:not(:placeholder-shown)+label {
    right: auto;
    left: 0.5rem;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Project Card Specific Animations */
.project-card {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(var(--animation-order) * 0.1s);
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    will-change: transform;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation for project cards */
.projects-grid .project-card:nth-child(1) {
    --animation-order: 1;
}

.projects-grid .project-card:nth-child(2) {
    --animation-order: 2;
}

.projects-grid .project-card:nth-child(3) {
    --animation-order: 3;
}

.projects-grid .project-card:nth-child(4) {
    --animation-order: 4;
}

.projects-grid .project-card:nth-child(5) {
    --animation-order: 5;
}

.projects-grid .project-card:nth-child(6) {
    --animation-order: 6;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Education Section Styles */
.education-section {
    padding: 6rem 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.education-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    pointer-events: none;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.education-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.education-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.education-item:hover::before {
    transform: scaleX(1);
}

.education-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-color);
}

.certificate-item {
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.certificate-item:hover {
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(139, 92, 246, 0.15) 100%);
}

.education-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.education-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.education-item:hover .education-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-xl);
}

.education-content {
    flex: 1;
}

.education-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.education-institution {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.education-period {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.education-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.certificate-image {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    max-width: 250px !important;
    max-height: 150px !important;
    width: 250px !important;
    height: 150px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.certificate-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.cert-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 250px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    display: block;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.certificate-image:hover .cert-img {
    transform: scale(1.05);
}

/* Responsive Design for Education Section */
@media (max-width: 768px) {
    .education-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .education-item {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }

    .education-icon {
        align-self: center;
        margin-bottom: 1rem;
    }

    .education-content h3 {
        font-size: 1.1rem;
    }

    .education-description {
        font-size: 0.9rem;
    }

    .certificate-image {
        max-width: 200px !important;
        max-height: 120px !important;
        width: 200px !important;
        height: 120px !important;
        margin: 1rem auto 0;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 480px) {
    .education-section {
        padding: 4rem 0;
    }

    .education-item {
        padding: 1.25rem;
    }

    .education-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .certificate-image {
        max-width: 150px !important;
        max-height: 100px !important;
        width: 150px !important;
        height: 100px !important;
        margin: 1rem auto 0;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Force certificate image sizing - Override any other styles */
.certificate-image img,
.cert-img {
    max-width: 250px !important;
    max-height: 150px !important;
    width: 250px !important;
    height: 150px !important;
    object-fit: contain !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

@media (max-width: 768px) {

    .certificate-image img,
    .cert-img {
        max-width: 200px !important;
        max-height: 120px !important;
        width: 200px !important;
        height: 120px !important;
        object-fit: contain !important;
    }
}

@media (max-width: 480px) {

    .certificate-image img,
    .cert-img {
        max-width: 150px !important;
        max-height: 100px !important;
        width: 150px !important;
        height: 100px !important;
        object-fit: contain !important;
    }
}

/* Certificate Image Modal */
.certificate-image {
    cursor: pointer;
}

.certificate-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Modal for certificate images */
.cert-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.cert-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
}

.cert-modal img {
    width: 100%;
    height: auto;
    display: block;
}

.cert-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cert-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}