/* CSS Variables for Theme Support */
:root {
    /* Light theme variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(45deg, #667eea, #764ba2);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(26, 26, 26, 0.95);
    --card-bg: #2d2d2d;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(45deg, #667eea, #764ba2);
}

[data-theme="dark"] .achievement-card,
[data-theme="dark"] .skill-category,
[data-theme="dark"] .project-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 1.5px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .achievement-card:hover,
[data-theme="dark"] .skill-category:hover,
[data-theme="dark"] .project-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Dark theme project tech tag adjustments */
[data-theme="dark"] .project-tech span {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
}

[data-theme="dark"] .project-professional .project-tech span {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
    color: #a5b4fc;
}

[data-theme="dark"] .project-opensource .project-tech span {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0.1) 100%);
    color: #68d391;
}

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

/* Add smooth transitions for theme changes */
*, *::before, *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
}

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

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 50px;
    height: 28px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 1rem;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: #667eea;
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(22px);
}

.theme-toggle-slider::before {
    content: '☀️';
}

[data-theme="dark"] .theme-toggle-slider::before {
    content: '🌙';
}

/* Theme Toggle Toast Notifications */
.theme-toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #667eea;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 300px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.theme-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.theme-toast.dark-theme {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3);
}

.theme-toast.light-theme {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333333;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.2);
}

.theme-toast.rapid-toggle {
    border-left-color: #ff6b35;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
    animation: wiggle 0.5s ease-in-out;
}

.theme-toast.mobile-easter-egg {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    animation: bounce 0.6s ease-in-out;
}

@keyframes wiggle {
    0%, 7% { transform: translateX(0) rotateZ(0); }
    15% { transform: translateX(-5px) rotateZ(-1deg); }
    20% { transform: translateX(4px) rotateZ(1deg); }
    25% { transform: translateX(-3px) rotateZ(-1deg); }
    30% { transform: translateX(2px) rotateZ(0deg); }
    35% { transform: translateX(-1px) rotateZ(0deg); }
    40%, 100% { transform: translateX(0) rotateZ(0); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-15px); }
    70% { transform: translateY(-7px); }
    90% { transform: translateY(-3px); }
}

.theme-toast-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
}

.theme-toast-message {
    font-weight: 500;
}

.theme-toast-submessage {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 4px;
    font-style: italic;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: 1rem;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    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;
}

.highlight {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
    line-height: 1.6;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    justify-content: left;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: #667eea;
    border-color: white;
}

.btn-primary:hover {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}

.hero-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Hero Social Links */
.hero-social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0;
}

.hero-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

/* Button-specific styles for email copy */
.hero-social-link[type="button"],
button.hero-social-link {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    outline: none;
}

.hero-social-link:hover {
    background: white;
    color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: white;
}

/* Different hover colors for each social platform */
.hero-social-link:nth-child(1):hover {
    background: #333;
    color: white;
    border-color: #333;
}

.hero-social-link:nth-child(2):hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.hero-social-link:nth-child(3):hover {
    background: #ea4335;
    color: white;
    border-color: #ea4335;
}

/* Section Styles */
section {
    padding: 80px 0;
}

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

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--gradient-secondary);
    display: block;
    margin: 20px auto;
    border-radius: 2px;
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: transform 0.3s ease;
    min-width: 200px;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    min-width: fit-content;
    display: block;
    width: 100%;
}

.stat p {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Experience Section */
.experience {
    background: var(--bg-primary);
}

.timeline {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-secondary);
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-item {
    display: flex;
    margin-bottom: 4rem;
    position: relative;
    align-items: flex-start;
    z-index: 1;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: left;
}

.timeline-item:nth-child(even) {
    text-align: left;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 0;
}

.timeline-date {
    flex: 0 0 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
}

.timeline-date::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    box-shadow: 0 0 0 4px #667eea;
    z-index: 3;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.timeline-date span {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    z-index: 4;
}

.timeline-content {
    flex: 1;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.timeline-content:hover {
    transform: translateY(-3px);
}

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

.timeline-content h4 {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
    padding: 0;
}

.timeline-content li {
    color: var(--text-secondary);
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.timeline-content li::before {
    content: '▸';
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Achievements Section */
.achievements {
    background: var(--bg-secondary);
    padding: 60px 0;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.achievement-card {
    background: var(--card-bg);
    padding: 1.4rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-top: 3px solid #667eea;
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.12);
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.achievement-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.achievement-content h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    line-height: 1.3;
}

.achievement-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.achievement-year {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Skills Section */
.skills {
    padding: 60px 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background: var(--card-bg);
    padding: 1.3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid #667eea;
}

.skill-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.12);
}

.skill-category h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.skill-item {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.3s ease;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.skill-item:hover {
    transform: scale(1.05);
}

.skill-item:hover::after {
    content: attr(data-fun-fact);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Projects Section */
.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.project-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12), 0 1.5px 6px rgba(0,0,0,0.06);
    transition: transform 0.3s cubic-bezier(.4,2,.6,1), box-shadow 0.3s cubic-bezier(.4,2,.6,1);
    border-top: 5px solid #667eea;
    position: relative;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.025);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.18), 0 2px 8px rgba(0,0,0,0.10);
}

/* Different border colors for project types */
.project-professional {
    border-top-color: #667eea;
}

.project-opensource {
    border-top-color: #28a745;
}

.project-opensource:hover {
    box-shadow: 0 16px 40px rgba(40, 167, 69, 0.18), 0 2px 8px rgba(0,0,0,0.10);
}

/* Subtle animation for professional project icons */
.project-professional:hover .project-icon-placeholder {
    transform: scale(1.05);
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced hover effect for open source project icons */
.project-opensource:hover .project-icon-placeholder {
    transform: scale(1.05);
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 1.5rem;
}

.project-header-content {
    flex: 1;
    margin-left: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-header-content h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
    text-align: center;
}



.project-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Icon placeholder for projects without images */
.project-icon-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Status badge only for special cases (can be removed if not needed) */
.project-status-badge {
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: none; /* Hidden by default */
}

.status-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Different styles for project types */
.project-professional .project-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.project-opensource .project-image {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Only show overlay on hover for projects that have links */
.project-opensource:hover .project-overlay {
    opacity: 1;
}

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

.project-link {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #28a745;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.project-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    height: 100%;
}

/* Add a small indicator for projects with links */
.project-opensource .project-content::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(40, 167, 69, 0.3);
}

.project-opensource .project-content::after {
    content: 'View Code';
    position: absolute;
    top: -6px;
    right: 35px;
    background: #28a745;
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.project-opensource:hover .project-content::after {
    opacity: 1;
}

.project-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.project-tech span {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-color) 100%);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(95, 99, 104, 0.1);
}

/* Different tech tag colors for project types */
.project-professional .project-tech span {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.2);
}

.project-opensource .project-tech span {
    background: linear-gradient(135deg, #e6f4ea 0%, #ceead6 100%);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.2);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.contact-item i {
    width: 20px;
    color: #667eea;
}

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

/* Contact section social links use hero-social-link styles but with theme adaptations */
.contact .social-links .hero-social-link {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.contact .social-links .hero-social-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

[data-theme="dark"] .contact .social-links .hero-social-link {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: #a5b4fc;
}

[data-theme="dark"] .contact .social-links .hero-social-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Platform-specific hover colors for contact section */
.contact .social-links .hero-social-link:nth-child(1):hover {
    background: #333;
    color: white;
    border-color: #333;
}

.contact .social-links .hero-social-link:nth-child(2):hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.contact .social-links .hero-social-link:nth-child(3):hover {
    background: #ea4335;
    color: white;
    border-color: #ea4335;
}

.contact .social-links .hero-social-link:nth-child(4):hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Keep old social-link class for backward compatibility if needed */
.social-link {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: scale(1.1);
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
    border-top: 4px solid #667eea;
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Enhanced submit button styling */
.contact-form .btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.contact-form .btn-primary:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

.contact-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.contact-form .btn-primary:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-status {
    margin-top: 1.5rem;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    border: none;
}

.form-status.success {
    background: linear-gradient(45deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.form-status.error {
    background: linear-gradient(45deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-note {
    margin-top: 1.5rem;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.form-note a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.form-note a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--bg-primary);
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px var(--shadow-light);
        padding: 2rem 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .theme-toggle {
        margin: 1rem auto 0 auto;
    }

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

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

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

    .hero-social-links {
        gap: 0.75rem;
        margin-top: 1.5rem;
        justify-content: center;
    }

    .hero-social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .profile-image img {
        width: 250px;
        height: 250px;
    }

    .hero-image {
        transform: none !important;
    }

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

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

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

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

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

    /* Timeline responsive */
    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item {
        flex-direction: column !important;
        padding-left: 50px;
        margin-bottom: 2rem;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        padding: 1.5rem;
        margin-left: 0;
        margin-right: 0;
    }

    .timeline-date {
        position: absolute;
        left: 0;
        top: 0;
        flex: none;
        width: auto;
        justify-content: flex-start;
    }

    .timeline-date::before {
        left: 20px;
        transform: translateX(-50%);
    }

    .timeline-date span {
        position: absolute;
        left: 40px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.8rem;
        padding: 6px 12px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

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

    .container {
        padding: 0 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .profile-image img {
        width: 200px;
        height: 200px;
    }

    .hero-image {
        transform: none !important;
    }

    /* Enhanced timeline mobile styles */
    .timeline-item {
        padding-left: 40px;
        margin-bottom: 1.5rem;
    }

    .timeline-date span {
        left: 35px;
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .timeline-content {
        padding: 1rem;
        margin-top: 0.5rem;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }

    .timeline-content h4 {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > * {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation-delay: 0.4s;
}

.hero-description {
    animation-delay: 0.6s;
}

.hero-buttons {
    animation-delay: 0.8s;
}

/* Smooth scrolling offset for fixed navbar */
html {
    scroll-padding-top: 70px;
}

/* Game Section Styles */
.game-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.game-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
}

/* Game Tabs */
.game-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.game-tab {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.game-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-medium);
}

.game-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.game-container {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.game-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.game-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--shadow-light);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-display {
    display: flex;
    gap: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-display span {
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
}

.game-controls-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* Show/hide controls based on device type */
.mobile-controls {
    display: none;
}

@media (max-width: 768px) {
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
}

.game-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.game-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#gameCanvas {
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-primary);
    box-shadow: inset 0 2px 10px var(--shadow-light);
    touch-action: none; /* Prevent default touch behaviors */
    user-select: none; /* Prevent text selection on touch */
}

.game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: gameOverFadeIn 0.5s ease-in-out;
    z-index: 100;
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes gameOverFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-over-screen h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.game-over-screen p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    color: #cccccc;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.stat-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* 2048 Game Styles */
.game2048-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 8px;
    padding: 10px;
    background: #bbada0;
    border-radius: 10px;
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
}

.game-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.game2048-cell {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 6px;
    width: 70px;
    height: 70px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game2048-tile {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    transition: left 0.25s cubic-bezier(0.23, 1, 0.32, 1), 
                top 0.25s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.2s ease-in-out,
                opacity 0.2s ease-in-out;
    z-index: 10;
}

/* Animation for new tiles */
@keyframes tileAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for tile merging */
@keyframes tileMerge {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.tile-merged {
    animation: tileMerge 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animation for sliding tiles */
@keyframes tileSlide {
    0% {
        transform: translateX(var(--slide-x, 0)) translateY(var(--slide-y, 0));
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* Special animations for high-value tiles */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(237, 194, 46, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(237, 194, 46, 0.8);
    }
}

.tile-1024, .tile-2048 {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* 2048 Tile Colors */
.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: #f9f6f2; }
.tile-16 { background: #f59563; color: #f9f6f2; }
.tile-32 { background: #f67c5f; color: #f9f6f2; }
.tile-64 { background: #f65e3b; color: #f9f6f2; }
.tile-128 { background: #edcf72; color: #f9f6f2; font-size: 28px; }
.tile-256 { background: #edcc61; color: #f9f6f2; font-size: 28px; }
.tile-512 { background: #edc850; color: #f9f6f2; font-size: 28px; }
.tile-1024 { background: #edc53f; color: #f9f6f2; font-size: 24px; }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: 24px; box-shadow: 0 0 20px rgba(237, 194, 46, 0.5); }

.tile-super { background: #3c3a32; color: #f9f6f2; font-size: 20px; }

.gaming-facts {
    text-align: center;
}

.gaming-facts h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.fact-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-medium);
}

.fact-card i {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.fact-card p {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

.refresh-facts-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0 2rem 0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 15px rgba(64, 123, 255, 0.3);
}

.refresh-facts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(64, 123, 255, 0.4);
}

.refresh-facts-btn:active {
    transform: translateY(0);
}

.refresh-facts-btn i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.refresh-facts-btn:hover i {
    transform: rotate(180deg);
}

.fact-card.loading {
    grid-column: 1 / -1;
    background: var(--card-bg);
    padding: 2rem;
    text-align: center;
}

.fact-card.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

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

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

/* Game Section Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        text-align: center;
    }
    
    .score-display {
        justify-content: center;
    }
    
    .game-buttons {
        justify-content: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
    
    .facts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 1rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-buttons {
        flex-direction: column;
    }
    
    .game-tabs {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .game-tab {
        width: 150px;
        text-align: center;
    }
    
    .game2048-grid {
        width: 280px;
        height: 280px;
        grid-gap: 6px;
        padding: 8px;
    }
    
    .game2048-cell,
    .game2048-tile {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .tile-128, .tile-256, .tile-512 {
        font-size: 20px;
    }
    
    .tile-1024, .tile-2048 {
        font-size: 18px;
    }
    
    .tile-super {
        font-size: 16px;
    }
}
