/* Base Styles & Variables */
:root {
    /* Light Theme */
    --primary-color: #6c63ff;
    --primary-light: #8a85ff;
    --primary-dark: #4a42cc;
    --secondary-color: #00b4d8;
    --text-color: #2d3436;
    --text-secondary: #636e72;
    --background: #ffffff;
    --background-secondary: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --gradient: linear-gradient(135deg, #6c63ff 0%, #00b4d8 100%);
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #8a85ff;
    --primary-light: #a8a4ff;
    --primary-dark: #4a42cc;
    --secondary-color: #00b4d8;
    --text-color: #f5f6fa;
    --text-secondary: #dcdde1;
    --background: #1e272e;
    --background-secondary: #2f3640;
    --card-bg: #2d3436;
    --border-color: #3d3d3d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    /*--gradient: linear-gradient(135deg, #8a85ff 0%, #00b4d8 100%);*/
    --gradient: linear-gradient(135deg, #ab6cfd 0%, #5a19ad 100%);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    transition: var(--transition);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-right: 1rem;
}

.btn-secondary:hover {
    background: rgba(108, 99, 255, 0.1);
    transform: translateY(-3px);
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background-color: rgba(30, 39, 46, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.header.scrolled {
    background-color: var(--background);
    box-shadow: var(--shadow);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    transition: none;
    z-index: auto;
    box-shadow: none;
    overflow-y: visible;
    margin: 0;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
    right: auto;
    left: 0;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
    margin-right: auto;
    margin-left: 1rem;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Language Switcher */
.language-switcher {
    position: relative;
    margin-left: 1.5rem;
    margin-right: 1rem;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    transition: var(--transition);
    white-space: nowrap;
}

.lang-toggle:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.2);
}

.lang-toggle .flag {
    font-size: 1.1rem;
    display: inline-block;
    line-height: 1;
    margin-right: 0.2rem;
}

.lang-toggle .arrow {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
    margin-left: 0.2rem;
}

.lang-toggle.active .arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--background-secondary);
    padding-left: 1.25rem;
}

.lang-option.active {
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.lang-option .flag {
    font-size: 1.4rem;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lang-option .lang-name {
    flex: 1;
}

.lang-option .lang-code {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Hero Section */
.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    position: relative;
    padding: 120px 0 60px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 80vh;
    height: 80vh;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.1) 0%, rgba(0, 180, 216, 0) 70%);
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-snippet {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 100%;
    overflow: hidden;
    transition: var(--transition);
}

.code-snippet pre {
    margin: 0;
    font-family: 'Fira Code', 'Vazirmatn', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    animation: fadeIn 0.6s ease-out forwards;
}

.code-snippet .keyword {
    color: #ff79c6;
}

.code-snippet .function {
    color: #50fa7b;
}

/* About Section */
.about {
    padding: 100px 0;
    background-color: var(--background-secondary);
}

.about-content {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 350px;
    height: 350px;
    border-radius: 20px;
    background: var(--gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
}

.image-placeholder i {
    font-size: 8rem;
    color: white;
    animation: bounce 3s infinite;
}

.personal-info {
    margin-top: 2rem;
}

.info-item {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
}

.info-label {
    font-weight: 600;
    min-width: 120px;
    color: var(--text-color);
}

.info-value {
    color: var(--text-secondary);
}

/* Skills Section */
.skills {
    padding: 100px 0;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.skill-bars {
    margin-bottom: 2rem;
}

.skill {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-info span:first-child {
    font-weight: 600;
    color: var(--text-color);
}

.skill-info span:last-child {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background-color: var(--background-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.skill-tag {
    background: var(--background-secondary);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.skill-tag:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

/* Experience Section */
.experience {
    padding: 100px 0;
    background-color: var(--background-secondary);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(50%);
    width: 2px;
    height: 100%;
    background: var(--gradient);
}

.timeline-item {
    margin-bottom: 50px;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.timeline-header {
    margin-bottom: 1.5rem;
    position: relative;
    padding-right: 20px;
}

.timeline-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.company {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.date {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--gradient);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.timeline-details {
    padding-right: 1rem;
}

.timeline-details li {
    position: relative;
    padding-right: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.timeline-details li::before {
    content: '▹';
    position: absolute;
    right: 0;
    color: var(--primary-color);
}

/* Contact Section */
.contact {
    padding: 100px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    transition: var(--transition);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    text-decoration: none;
}

.contact-method:hover {
    background-color: var(--background-secondary);
    transform: translateX(-5px);
}

.contact-method i {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 1rem;
    font-size: 1.2rem;
}

.contact-methods a span{
    margin-left: 1rem;
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* Footer */
.footer {
    background-color: var(--background-secondary);
    padding: 60px 0 30px;
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle i {
    position: absolute;
    font-size: 1.2rem;
    transition: var(--transition);
    opacity: 0;
    transform: scale(0.5);
}

.theme-toggle i.active {
    opacity: 1;
    transform: scale(1);
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
    margin-top: 2rem !important;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 #00fff9;
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skill-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.skill-item i {
    font-size: 1.8rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-item h4 {
    margin: 0 0 0.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.skill-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* About Highlights */
.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.highlight-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.highlight-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight-item h4 {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

.highlight-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Code Snippet Styling */
.code-snippet {
    background: #282c34;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: 'Fira Code', 'Vazirmatn', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.code-snippet pre {
    margin: 0;
}

.code-snippet code {
    font-family: 'Fira Code', 'Vazirmatn', monospace;
}

/* Syntax Highlighting */
.keyword {
    color: #ff79c6;
}

.string {
    color: #50fa7b;
}

.comment {
    color: #6272a4;
    font-style: italic;
}

.variable {
    color: #f8f8f2;
}

.function {
    color: #66d9ef;
}

.type {
    color: #8be9fd;
    font-style: italic;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
    100% {
        transform: translateY(0) translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glitch-anim-1 {
    0% { clip: rect(0, 9999px, 0, 0); }
    5% { clip: rect(50px, 9999px, 60px, 0); }
    10% { clip: rect(20px, 9999px, 40px, 0); }
    15% { clip: rect(70px, 9999px, 80px, 0); }
    20% { clip: rect(10px, 9999px, 30px, 0); }
    25% { clip: rect(60px, 9999px, 70px, 0); }
    30% { clip: rect(30px, 9999px, 50px, 0); }
    35% { clip: rect(80px, 9999px, 90px, 0); }
    40% { clip: rect(15px, 9999px, 35px, 0); }
    45% { clip: rect(65px, 9999px, 75px, 0); }
    50% { clip: rect(25px, 9999px, 45px, 0); }
    55% { clip: rect(75px, 9999px, 85px, 0); }
    60% { clip: rect(5px, 9999px, 25px, 0); }
    65% { clip: rect(55px, 9999px, 65px, 0); }
    70% { clip: rect(35px, 9999px, 55px, 0); }
    75% { clip: rect(85px, 9999px, 95px, 0); }
    80% { clip: rect(20px, 9999px, 40px, 0); }
    85% { clip: rect(70px, 9999px, 80px, 0); }
    90% { clip: rect(40px, 9999px, 60px, 0); }
    95% { clip: rect(90px, 9999px, 100px, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(0, 9999px, 0, 0); }
    5% { clip: rect(45px, 9999px, 55px, 0); }
    10% { clip: rect(15px, 9999px, 35px, 0); }
    15% { clip: rect(65px, 9999px, 75px, 0); }
    20% { clip: rect(5px, 9999px, 25px, 0); }
    25% { clip: rect(55px, 9999px, 65px, 0); }
    30% { clip: rect(25px, 9999px, 45px, 0); }
    35% { clip: rect(75px, 9999px, 85px, 0); }
    40% { clip: rect(10px, 9999px, 30px, 0); }
    45% { clip: rect(60px, 9999px, 70px, 0); }
    50% { clip: rect(30px, 9999px, 50px, 0); }
    55% { clip: rect(80px, 9999px, 90px, 0); }
    60% { clip: rect(0px, 9999px, 20px, 0); }
    65% { clip: rect(50px, 9999px, 60px, 0); }
    70% { clip: rect(40px, 9999px, 60px, 0); }
    75% { clip: rect(90px, 9999px, 100px, 0); }
    80% { clip: rect(15px, 9999px, 35px, 0); }
    85% { clip: rect(65px, 9999px, 75px, 0); }
    90% { clip: rect(35px, 9999px, 55px, 0); }
    95% { clip: rect(85px, 9999px, 95px, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero {
        text-align: center;
        padding: 100px 0 60px;
    }

    .hero-content {
        margin: 0 auto 3rem;
    }

    .hero p {
        margin: 0 auto 2rem;
    }

    .cta-buttons {
        justify-content: center;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .timeline::before {
        right: 31px;
    }

    .timeline-item {
        padding-right: 70px;
    }
}

/* Light Theme Code Snippet */
[data-theme="light"] .code-snippet {
    background: #f5f7fa;
    border: 1px solid #e1e4e8;
}

[data-theme="light"] .code-snippet .keyword {
    color: #d73a49;
}

[data-theme="light"] .code-snippet .string {
    color: #032f62;
}

[data-theme="light"] .code-snippet .comment {
    color: #6a737d;
}

[data-theme="light"] .code-snippet .variable {
    color: #24292e;
}

[data-theme="light"] .code-snippet .function {
    color: #6f42c1;
}

[data-theme="light"] .code-snippet .type {
    color: #005cc5;
}

[data-theme="light"] .code-snippet .class-name {
    color: #6f42c1;
}

/* Responsive Adjustments */
/* Mobile Navigation */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    /* Fix horizontal scrolling */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Fix navbar alignment */
    .header {
        right: 0;
        left: auto;
        padding: 0 1rem;
        width: 100%;
    }
    
    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
        width: 28px;
        height: 22px;
        margin-left: 1rem;
        margin-right: auto;
        padding: 0;
    }
    
    .hamburger span {
        width: 100%;
        height: 3px;
        background-color: var(--text-color);
    }
    
    /* Fix nav menu positioning */
    .nav-links {
        position: fixed;
        top: 0;
        right: -300px;
        left: auto;
        width: 280px;
        height: 100vh;
        background: var(--background);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 80px 1.5rem 2rem;
        transition: transform 0.4s ease;
        z-index: 1001;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        margin: 0;
    }
    
    .nav-links.active {
        transform: translateX(0);
        right: 0;
    }
    
    /* Fix theme toggle position */
    .theme-toggle {
        left: 20px;
        right: auto;
        bottom: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* Ensure theme toggle is clickable */
    .theme-toggle i {
        font-size: 1.3rem;
    }
    .hero {
        padding: 80px 0 40px;
        min-height: auto;
        text-align: center;
    }
    
    .hero .container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .hero-content {
        padding: 0 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-image {
        order: 0;
        margin-bottom: 2rem;
        width: 100%;
        padding: 0 1rem;
    }
    
    .code-snippet {
        display: block !important;
        width: 100%;
        margin: 0 auto;
        font-size: 0.75rem;
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        transform: none !important;
    }
    
    .code-snippet pre {
        white-space: pre;
        overflow-x: auto;
        margin: 0;
    }
    
    .cta-buttons {
        justify-content: center;
    }
    
    .skills-grid,
    .about-highlights {
        grid-template-columns: 1fr;
    }
    
    .skill-item,
    .highlight-item {
        padding: 1.2rem;
    }
    
    /* Language Switcher Mobile */
    .language-switcher {
        margin-left: 0.3rem;
        margin-right: 0.3rem;
    }
    
    .lang-toggle {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .lang-toggle .flag {
        font-size: 0.9rem;
        margin-right: 0.1rem;
    }
    
    .lang-toggle .arrow {
        font-size: 0.5rem;
        margin-left: 0.1rem;
    }
    
    .lang-dropdown {
        min-width: 160px;
        right: -5px;
    }
    
    .lang-option {
        padding: 0.6rem 0.8rem;
    }
    
    .lang-option:hover {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .code-snippet {
        font-size: 0.7rem;
        padding: 0.8rem;
    }
    
    .hero {
        padding: 70px 0 30px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }

    h1 {
        font-size: 2.8rem;
    }
}

/* RTL Layout Fixes */
[dir="rtl"] .theme-toggle {
    left: 20px;
    right: auto;
}

[dir="rtl"] .nav-links {
    text-align: right;
    padding-right: 2rem;
}

/* Animation for code snippet */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hamburger animation styles */
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        margin: 0;
    }

    .timeline::before {
        right: 15px;
    }

    .timeline-item {
        padding-right: 40px;
    }
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .header, .theme-toggle, .footer, .cta-buttons, .contact-form {
        display: none !important;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    section {
        padding: 20px 0 !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    a {
        text-decoration: none;
        color: #000;
    }

    .skill-tags {
        display: none;
    }
}
