/* CSS Variables for maintainability */
:root {
    /* Colors */
    --black-primary: #000000;
    --black-secondary: #111111;
    --white: #ffffff;
    --red-primary: #E63946;
    --red-secondary: #D90429;
    --red-accent: #FF1744;
    --gray-light: #f5f5f5;
    --gray-dark: #333333;
    --gray-medium: #666666;
    
    /* Theme-specific colors */
    --dark-bg: #000000;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --light-bg: #ffffff;
    --dark-text: #000000;
    --dark-text-secondary: #333333;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-size-base: 16px;
    --font-size-h1: 3.5rem;
    --font-size-h2: 2.5rem;
    --font-size-h3: 1.8rem;
    --font-size-h4: 1.4rem;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Breakpoints */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --transition-slow: 0.8s ease;
    
    /* Shadows */
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-red: 0 0 20px rgba(230, 57, 70, 0.3);
}

/* Light theme variables */
[data-theme="light"] {
    --black-primary: #ffffff;
    --black-secondary: #f5f5f5;
    --white: #000000;
    --gray-light: #333333;
    --gray-dark: #f5f5f5;
    --gray-medium: #999999;
    
    /* Theme-specific colors for light theme */
    --dark-bg: #ffffff;
    --card-bg: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --light-bg: #ffffff;
    --dark-text: #000000;
    --dark-text-secondary: #333333;
}

/* Light theme project card overrides */
[data-theme="light"] .project-card {
    background: #ffffff;
    border-color: rgba(230, 57, 70, 0.3);
}

[data-theme="light"] .project-content h3 {
    color: #000000;
    text-shadow: none;
}

[data-theme="light"] .project-overlay p {
    color: #000000;
    text-shadow: none;
}

[data-theme="light"] .project-overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(230, 57, 70, 0.3);
}

[data-theme="light"] .project-card:hover .project-overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
    border-color: rgba(230, 57, 70, 0.5);
}

/* Light theme project icon overrides */
[data-theme="light"] .project-image {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

[data-theme="light"] .project-icon {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1), rgba(217, 4, 41, 0.05));
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.15);
}

[data-theme="light"] .project-icon i {
    color: rgba(230, 57, 70, 0.6);
    text-shadow: 0 0 20px rgba(230, 57, 70, 0.3);
}

[data-theme="light"] .project-card:hover .project-icon {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.15), rgba(217, 4, 41, 0.08));
    box-shadow: 0 12px 48px rgba(230, 57, 70, 0.25);
}

[data-theme="light"] .project-card:hover .project-icon i {
    color: rgba(230, 57, 70, 0.8);
    text-shadow: 0 0 30px rgba(230, 57, 70, 0.5);
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    background-color: var(--black-primary);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-primary), var(--red-secondary));
    color: var(--white);
    box-shadow: var(--shadow-red);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--red-primary);
}

.btn-secondary:hover {
    background: var(--red-primary);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--red-primary);
    border: 2px solid var(--red-primary);
}

.btn-outline:hover {
    background: var(--red-primary);
    color: var(--white);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all var(--transition-fast);
    will-change: transform;
    transform: translateY(0);
}

/* Navbar hide/show classes */
.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.navbar.navbar-visible {
    transform: translateY(0);
}

/* Force white navbar in light theme */
[data-theme="light"] .navbar {
    background: #ffffff !important;
    color: #333333 !important;
}

/* Light theme navbar hide/show classes */
[data-theme="light"] .navbar.navbar-hidden {
    transform: translateY(-100%);
}

[data-theme="light"] .navbar.navbar-visible {
    transform: translateY(0);
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-logo a:hover {
    color: var(--red-secondary);
}

.nav-menu {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red-primary);
    transition: width var(--transition-fast);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 3px 0;
    transition: var(--transition-fast);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 70px; /* Account for fixed navbar height */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.red-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(230, 57, 70, 0.1) 0%, 
        rgba(217, 4, 41, 0.05) 50%, 
        rgba(0, 0, 0, 0) 100%);
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(230, 57, 70, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(217, 4, 41, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(230, 57, 70, 0.05) 0%, transparent 50%);
    animation: particleDrift 20s linear infinite;
}

@keyframes particleDrift {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.hero-text {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--white), var(--red-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 5px rgba(230, 57, 70, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(230, 57, 70, 0.6)); }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--red-primary);
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-description p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--white);
    white-space: nowrap;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInRight 1s ease-out 0.3s both;
}

.profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--red-primary);
    box-shadow: var(--shadow-red);
    transition: transform var(--transition-fast);
}

.profile-img:hover {
    transform: scale(1.05);
}

.scroll-cue {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--red-primary);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.scroll-cue:hover {
    color: var(--red-secondary);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

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

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

/* Section Styles */
section {
    padding: var(--spacing-lg) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

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

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

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.about-text p {
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
}

.highlight {
    color: var(--red-primary);
    font-weight: 600;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red-primary);
    animation: underlineExpand 0.8s ease-out 0.5s forwards;
}

@keyframes underlineExpand {
    to { width: 100%; }
}

.about-stats {
    display: grid;
    gap: var(--spacing-md);
}

.stat {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(230, 57, 70, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(230, 57, 70, 0.2);
    transition: transform var(--transition-fast);
}

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

.stat h3 {
    font-size: 2.5rem;
    color: var(--red-primary);
    margin-bottom: var(--spacing-xs);
}

.stat p {
    color: var(--gray-medium);
    font-weight: 500;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    width: 100%;
}

.project-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--black-secondary);
    border: 2px solid rgba(230, 57, 70, 0.2);
    transition: all var(--transition-medium);
    will-change: transform;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    min-height: 300px;
    width: 100%;
    margin: 0;
    backdrop-filter: blur(10px);
    opacity: 1;
    transform: translateY(0);
    /* Remove complex animations that cause blinking */
    animation: none;
}

/* Remove individual card animation delays that cause issues */
.project-card:nth-child(1),
.project-card:nth-child(2),
.project-card:nth-child(3),
.project-card:nth-child(4),
.project-card:nth-child(5),
.project-card:nth-child(6) {
    animation: none;
}

/* Simplified float animation that's more stable */
@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--red-primary);
    box-shadow: 0 15px 40px rgba(230, 57, 70, 0.4), 0 0 30px rgba(230, 57, 70, 0.2);
    animation: none;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(230, 57, 70, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
    z-index: 1;
}

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

.project-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--black-secondary), var(--black-primary));
}

.project-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1), rgba(217, 4, 41, 0.05));
    transition: all var(--transition-medium);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-lg);
    box-sizing: border-box;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.1);
    z-index: 1;
    opacity: 0.6;
}

.project-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(230, 57, 70, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-medium);
    border-radius: 50%;
}

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

.project-icon i {
    font-size: 3rem;
    color: rgba(230, 57, 70, 0.4);
    transition: all var(--transition-medium);
    text-shadow: 0 0 20px rgba(230, 57, 70, 0.3);
    z-index: 1;
    position: relative;
    max-width: 80%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(230, 57, 70, 0.2));
}

.project-card:hover .project-icon {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.15), rgba(217, 4, 41, 0.08));
    box-shadow: 0 12px 48px rgba(230, 57, 70, 0.2);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.8;
}

.project-card:hover .project-icon i {
    transform: scale(1.2) rotate(5deg);
    color: rgba(230, 57, 70, 0.6);
    text-shadow: 0 0 30px rgba(230, 57, 70, 0.5);
    filter: drop-shadow(0 4px 8px rgba(230, 57, 70, 0.3));
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    transition: all var(--transition-medium);
    border: 1px solid rgba(230, 57, 70, 0.2);
    z-index: 2;
}

.project-card:hover .project-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.9) 100%);
    border-color: rgba(230, 57, 70, 0.4);
}

.project-content h3 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.3px;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.project-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    justify-content: center;
}

.project-overlay p {
    color: var(--white);
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    opacity: 0.9;
    max-width: 100%;
    word-wrap: break-word;
}

.project-overlay .btn {
    margin-top: var(--spacing-xs);
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 6px;
    transition: all var(--transition-fast);
    background: rgba(230, 57, 70, 0.9);
    color: var(--white);
    border: 1px solid rgba(230, 57, 70, 0.8);
    flex-shrink: 0;
}

.project-overlay .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.6);
    background: var(--red-primary);
    border-color: var(--red-primary);
}

/* Skills Section */
.skills {
    background: var(--black-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.skill-card {
    position: relative;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

.skill-front,
.skill-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    transition: transform var(--transition-medium);
}

.skill-front {
    background: var(--black-primary);
    border: 2px solid rgba(230, 57, 70, 0.2);
}

.skill-back {
    background: var(--red-primary);
    transform: rotateY(180deg);
}

.skill-card:hover .skill-front {
    transform: rotateY(180deg);
}

.skill-card:hover .skill-back {
    transform: rotateY(0);
}

.skill-front i {
    font-size: 3rem;
    color: var(--red-primary);
    margin-bottom: var(--spacing-sm);
    transition: color var(--transition-fast);
}

.skill-card:hover .skill-front i {
    color: var(--red-secondary);
}

.skill-front h3 {
    color: var(--white);
    text-align: center;
}

.skill-back h3 {
    color: var(--white);
    text-align: center;
    margin-bottom: var(--spacing-xs);
}

.skill-back p {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}



/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.contact-info h3 {
    color: var(--red-primary);
    margin-bottom: var(--spacing-sm);
}

.contact-connect-description {
    margin-bottom: var(--spacing-sm);
}

.contact-connect-description p {
    margin-bottom: var(--spacing-xs);
}

.contact-details {
    margin: var(--spacing-md) 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(230, 57, 70, 0.1);
    border-radius: 8px;
    transition: transform var(--transition-fast);
}

.contact-item:hover {
    transform: translateX(10px);
}

.contact-item i {
    color: var(--red-primary);
    font-size: 1.2rem;
    width: 20px;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(230, 57, 70, 0.1);
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--red-primary);
    transform: translateY(-3px);
}

.social-link i {
    font-size: 1.2rem;
}

/* Contact Form */
.contact-form {
    background: var(--black-secondary);
    padding: var(--spacing-md);
    border-radius: 12px;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.form-group {
    position: relative;
    margin-bottom: var(--spacing-md);
}

/* Ensure message textarea has proper positioning for character counter */
.form-group textarea {
    position: relative;
    min-height: 120px;
    resize: vertical;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 2px solid rgba(230, 57, 70, 0.3);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--gray-medium);
    transition: all var(--transition-fast);
    pointer-events: none;
    background: transparent;
    padding: 0 5px;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    opacity: 0;
    visibility: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-content {
    background-color: var(--black-secondary);
    margin: 5% auto;
    padding: var(--spacing-md);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    border: 2px solid var(--red-primary);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--red-primary);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body h2 {
    color: var(--red-primary);
    margin-bottom: var(--spacing-sm);
}

.modal-tech {
    margin: var(--spacing-md) 0;
}

.modal-tech h3 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.modal-links {
    margin-top: var(--spacing-md);
}

.modal-links a {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--red-primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    z-index: 1000;
    will-change: transform;
}

.back-to-top:hover {
    background: var(--red-secondary);
    transform: scale(1.1);
}

.back-to-top.show {
    display: flex;
    animation: slideInUp 0.3s ease-out;
}

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--red-primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--red-secondary);
    transform: scale(1.1);
}

/* Experience Section */
.experience {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-primary) 100%);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--red-primary) 0%, var(--red-secondary) 100%);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    padding-left: 80px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    background: var(--black-primary);
    border: 3px solid var(--red-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all var(--transition-medium);
    transform: translateX(-1px);
}

.timeline-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.timeline-icon {
    color: var(--red-primary);
    font-size: 1.2rem;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium);
}

.timeline-content:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(230, 57, 70, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.timeline-header h3 {
    color: var(--white);
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.company-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.company-logo {
    flex-shrink: 0;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--white);
}

.company-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    transition: all var(--transition-fast);
}

.company-logo-img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.logo-placeholder.ntt-data {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.logo-placeholder.bitdefender {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.company-details h4 {
    color: var(--red-primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.company-details p {
    color: var(--gray-medium);
    font-size: 0.9rem;
    margin: 2px 0;
}

.employment-type {
    color: var(--red-secondary) !important;
    font-weight: 500;
}

.timeline-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.skill-tag {
    background: rgba(230, 57, 70, 0.2);
    color: var(--red-primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(230, 57, 70, 0.3);
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    background: rgba(230, 57, 70, 0.3);
    transform: translateY(-2px);
}

/* Education Section */
.education {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--black-primary) 0%, var(--black-secondary) 100%);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.education-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-secondary));
    transform: scaleX(0);
    transition: transform var(--transition-medium);
}

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

.education-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(230, 57, 70, 0.4);
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.education-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.university-logo {
    flex-shrink: 0;
}

.university-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    transition: all var(--transition-fast);
}

.university-logo-img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.logo-placeholder.tu-cluj {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
}

.education-details h3 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
}

.education-details h4 {
    color: var(--red-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.education-details p {
    color: var(--gray-medium);
    font-size: 0.9rem;
    margin: 3px 0;
}

.education-grade {
    color: #10b981 !important;
    font-weight: 600;
}

.education-status {
    color: var(--red-secondary) !important;
    font-weight: 500;
}

.education-content {
    color: var(--gray-medium);
    line-height: 1.6;
}

.education-content p {
    margin-bottom: 15px;
}

.education-achievements h5 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.education-achievements ul {
    list-style: none;
    padding: 0;
}

.education-achievements li {
    color: var(--gray-medium);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.education-achievements li::before {
    content: '▸';
    color: var(--red-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Light theme overrides for Experience and Education */
[data-theme="light"] .timeline-content {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(230, 57, 70, 0.3);
}

[data-theme="light"] .timeline-content:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(230, 57, 70, 0.5);
}

[data-theme="light"] .education-card {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(230, 57, 70, 0.3);
}

[data-theme="light"] .education-card:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(230, 57, 70, 0.5);
}

[data-theme="light"] .timeline-header h3,
[data-theme="light"] .education-details h3 {
    color: #000000;
}

[data-theme="light"] .education-content,
[data-theme="light"] .education-achievements li {
    color: #333333;
}

/* Light theme navigation overrides */
[data-theme="light"] .navbar {
    background: #ffffff !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(230, 57, 70, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-link {
    color: #333333 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

[data-theme="light"] .nav-link:hover {
    color: var(--red-primary) !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

[data-theme="light"] .bar {
    background: #333333;
}

[data-theme="light"] .nav-toggle.active .bar:nth-child(2) {
    background: #333333;
}

[data-theme="light"] .nav-toggle.active .bar:nth-child(1) {
    background: #333333;
}

[data-theme="light"] .nav-toggle.active .bar:nth-child(3) {
    background: #333333;
}

/* Ensure navigation is visible in both themes */
.nav-link {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3) !important;
}

.nav-link:hover {
    color: var(--red-primary) !important;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5) !important;
}

/* Force light theme navigation visibility */
[data-theme="light"] .nav-menu {
    background: transparent !important;
}

[data-theme="light"] .nav-menu .nav-link {
    color: #333333 !important;
    text-shadow: none !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

[data-theme="light"] .nav-menu .nav-link:hover {
    color: var(--red-primary) !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Responsive design for Experience and Education */
@media (max-width: 768px) {
    .timeline {
        padding: 0 10px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 60px;
        margin-bottom: 40px;
    }
    
    .timeline-marker {
        width: 40px;
        height: 40px;
        transform: translateX(-1px);
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .company-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .company-logo-img {
        width: 40px;
        height: 40px;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .education-card {
        padding: 20px;
    }
    
    .education-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .university-logo-img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-marker {
        width: 35px;
        height: 35px;
        transform: translateX(-1px);
    }
    
    .timeline-icon {
        font-size: 1rem;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-header h3 {
        font-size: 1.2rem;
    }
    
    .company-logo-img {
        width: 35px;
        height: 35px;
    }
    
    .education-card {
        padding: 15px;
    }
    
    .education-details h3 {
        font-size: 1.1rem;
    }
    
    .university-logo-img {
        width: 45px;
        height: 45px;
    }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 0 var(--spacing-sm);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
    
    .project-card {
        min-height: 320px;
        width: 100%;
    }
    
    .project-content h3 {
        font-size: 1.3rem;
    }
    
    .project-overlay p {
        font-size: 0.95rem;
    }
    
    .project-icon {
        width: 110px;
        height: 110px;
    }
    
    .project-icon i {
        font-size: 2.8rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .education-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .research-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    /* Enhanced Tablet Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--black-primary) !important;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: var(--spacing-md) 0;
        backdrop-filter: none;
        border-top: 2px solid rgba(230, 57, 70, 0.3);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* Dark theme mobile navigation links */
    .nav-menu .nav-link {
        color: var(--white) !important;
        font-weight: 600 !important;
        text-shadow: none !important;
        opacity: 1 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 15px 20px;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .nav-menu .nav-link:hover {
        color: var(--red-primary) !important;
        background-color: rgba(230, 57, 70, 0.1);
        text-shadow: none !important;
        opacity: 1 !important;
    }
    
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Light theme mobile navigation */
    [data-theme="light"] .nav-menu {
        background-color: #ffffff !important;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.15);
        border-top: 2px solid rgba(230, 57, 70, 0.2);
        backdrop-filter: none;
    }
    
    [data-theme="light"] .nav-menu .nav-link {
        color: #333333 !important;
        font-weight: 600 !important;
        text-shadow: none !important;
        opacity: 1 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 15px 20px;
        transition: all 0.3s ease;
    }
    
    [data-theme="light"] .nav-menu .nav-link:hover {
        color: var(--red-primary) !important;
        background-color: rgba(230, 57, 70, 0.1);
        text-shadow: none !important;
        opacity: 1 !important;
    }
    
    [data-theme="light"] .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Enhanced Hero Section for Tablets */
    .hero {
        padding-top: 80px; /* Account for tablet navbar height */
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-description p {
        white-space: normal;
        line-height: 1.6;
    }
    
    .profile-img {
        width: 280px;
        height: 280px;
    }
    
    /* Enhanced Projects Grid for Tablets */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
    
    .project-card {
        min-height: 300px;
        width: 100%;
        margin: 0;
    }
    
    .project-image {
        height: 160px;
    }
    
    .project-icon {
        width: 90px;
        height: 90px;
    }
    
    .project-icon i {
        font-size: 2.4rem;
    }
    
    .project-overlay {
        padding: var(--spacing-md);
    }
    
    .project-content h3 {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .project-overlay p {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Enhanced Skills Grid for Tablets */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .skill-card {
        height: 180px;
    }
    
    .skill-front i {
        font-size: 2.5rem;
    }
    
    /* Enhanced Contact Section for Tablets */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .contact-form {
        padding: var(--spacing-lg);
    }

    .contact-connect-description p {
        text-align: justify;
    }
    
    /* Enhanced Buttons for Tablets */
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    /* Enhanced Section Titles for Tablets */
    .section-title {
        font-size: 2.2rem;
    }
    
    /* Enhanced Timeline for Tablets */
    .timeline-item {
        padding-left: 70px;
        margin-bottom: 50px;
    }
    
    .timeline-marker {
        width: 50px;
        height: 50px;
        transform: translateX(-1px);
    }
    
    .timeline-content {
        padding: 25px;
    }
    
    .company-info {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    /* Enhanced Education Cards for Tablets */
    .education-card {
        padding: 25px;
    }
    
    .education-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }
    
    /* Enhanced Research Cards for Tablets */
    .research-card {
        padding: 25px;
    }
    
    .research-header {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }
    
    /* Enhanced Language Dropdown for Tablets */
    .nav-controls {
        gap: 12px;
        justify-content: flex-end;
    }
    
    /* Tablet theme toggle - inside navbar */
    .theme-toggle {
        position: static;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: auto;
        right: auto;
    }
    
    .lang-dropdown-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .lang-dropdown-menu {
        right: -15px;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    /* Enhanced Mobile Styles */
    .container {
        padding: 0 var(--spacing-xs);
        max-width: 100%;
    }
    
    /* Enhanced Mobile Hero Section */
    .hero {
        min-height: 100vh;
        padding: 20px 0;
        padding-top: 85px; /* Account for mobile navbar height (65px) + extra spacing */
    }
    
    .hero-content {
        padding: 0 var(--spacing-xs);
        gap: var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.1;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-description p {
        white-space: normal;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
    
    .profile-img {
        width: 220px;
        height: 220px;
        border-width: 3px;
    }
    
    /* Enhanced Mobile Buttons */
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
        max-width: 250px;
    }
    
    /* Enhanced Mobile Navigation */
    .nav-container {
        padding: 0 var(--spacing-xs);
        height: 65px;
    }
    
    .nav-logo a {
        font-size: 1.3rem;
    }
    
    .nav-controls {
        gap: 8px;
        justify-content: flex-end;
    }
    
    /* Mobile theme toggle - inside navbar */
    .theme-toggle {
        position: static;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: auto;
        right: auto;
    }
    
    .lang-dropdown-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .lang-dropdown-menu {
        right: -10px;
        min-width: 130px;
    }
    
    .lang-option {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    /* Enhanced Mobile Section Titles */
    .section-title {
        font-size: 1.9rem;
        margin-bottom: var(--spacing-md);
    }
    
    /* Enhanced Mobile Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        padding: 0 var(--spacing-xs);
    }
    
    .project-card {
        min-height: 260px;
        margin: 0;
    }
    
    .project-image {
        height: 140px;
    }
    
    .project-icon {
        width: 70px;
        height: 70px;
    }
    
    .project-icon i {
        font-size: 2rem;
    }
    
    .project-overlay {
        padding: var(--spacing-sm);
    }
    
    .project-content h3 {
        font-size: 1rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .project-overlay p {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Enhanced Mobile Skills */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--spacing-xs);
    }
    
    .skill-card {
        height: 150px;
    }
    
    .skill-front i {
        font-size: 2rem;
    }
    
    .skill-front h3 {
        font-size: 1rem;
    }
    
    .skill-back h3 {
        font-size: 1rem;
    }
    
    .skill-back p {
        font-size: 0.8rem;
    }
    
    /* Enhanced Mobile Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .contact-form {
        padding: var(--spacing-md);
    }

    .contact-connect-description p {
        text-align: justify;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .contact-item {
        padding: var(--spacing-xs);
        margin-bottom: var(--spacing-xs);
    }
    
    .social-links {
        gap: var(--spacing-xs);
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    /* Enhanced Mobile Timeline */
    .timeline-item {
        padding-left: 45px;
        margin-bottom: 35px;
    }
    
    .timeline-marker {
        width: 35px;
        height: 35px;
        transform: translateX(-1px);
    }
    
    .timeline-icon {
        font-size: 0.9rem;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-header h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .company-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .company-logo-img {
        width: 35px;
        height: 35px;
    }
    
    .company-details h4 {
        font-size: 1rem;
    }
    
    .company-details p {
        font-size: 0.8rem;
    }
    
    /* Enhanced Mobile Education */
    .education-card {
        padding: 15px;
    }
    
    .education-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .university-logo-img {
        width: 45px;
        height: 45px;
    }
    
    .education-details h3 {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .education-details h4 {
        font-size: 0.9rem;
    }
    
    .education-details p {
        font-size: 0.8rem;
    }
    
    /* Enhanced Mobile Research */
    .research-card {
        padding: 15px;
    }
    
    .research-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .research-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .research-details h3 {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .research-abstract p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .keyword-tags {
        gap: 6px;
    }
    
    .keyword-tag {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Enhanced Mobile Modals */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: var(--spacing-sm);
    }
    
    .cv-modal-content {
        width: 95vw;
        height: 90vh;
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .cv-modal-content .modal-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .cv-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cv-actions .btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Enhanced Mobile Floating Buttons */
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        bottom: 20px;
        right: 20px;
    }
    
    /* Enhanced Mobile About Section */
    .about-text p {
        font-size: 1rem;
        line-height: 1.6;
        text-align: justify;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat {
        padding: var(--spacing-sm);
    }
    
    .stat h3 {
        font-size: 2rem;
    }
    
    .stat p {
        font-size: 0.9rem;
    }
    
    /* Enhanced Mobile Scroll Cue */
    .scroll-cue {
        bottom: 20px;
        font-size: 1.2rem;
    }
    
    /* Enhanced Mobile Loading */
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    /* Enhanced Mobile Install Prompt */
    .install-prompt {
        bottom: 15px;
        left: 10px;
        right: 10px;
        transform: none;
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    .install-prompt button {
        padding: 6px 12px;
        font-size: 0.8rem;
        margin-left: 8px;
    }
    
    /* Enhanced Mobile Offline Indicator */
    .offline-indicator {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.9rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .profile-img {
        width: 180px;
        height: 180px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        max-width: 200px;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .project-card {
        min-height: 240px;
    }
    
    .project-image {
        height: 120px;
    }
    
    .project-icon {
        width: 60px;
        height: 60px;
    }
    
    .project-icon i {
        font-size: 1.8rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .skill-card {
        height: 130px;
    }
    
    .skill-front i {
        font-size: 1.8rem;
    }
    
    .skill-front h3,
    .skill-back h3 {
        font-size: 0.9rem;
    }
    
    .skill-back p {
        font-size: 0.75rem;
    }
    
    .timeline-item {
        padding-left: 40px;
    }
    
    .timeline-marker {
        width: 30px;
        height: 30px;
        transform: translateX(-1px);
    }
    
    .timeline-icon {
        font-size: 0.8rem;
    }
    
    .company-logo-img {
        width: 30px;
        height: 30px;
    }
    
    .university-logo-img {
        width: 40px;
        height: 40px;
    }
    
    .research-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 10px 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
        align-items: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .profile-img {
        width: 150px;
        height: 150px;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        max-width: none;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .project-card {
        min-height: 200px;
    }
    
    .project-image {
        height: 100px;
    }
    
    .project-icon {
        width: 50px;
        height: 50px;
    }
    
    .project-icon i {
        font-size: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .skill-card {
        height: 120px;
    }
    
    .skill-front i {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Large Mobile Devices (iPhone Plus, etc.) */
@media (min-width: 481px) and (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .profile-img {
        width: 240px;
        height: 240px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .project-card {
        min-height: 280px;
    }
    
    .project-image {
        height: 150px;
    }
    
    .project-icon {
        width: 80px;
        height: 80px;
    }
    
    .project-icon i {
        font-size: 2.2rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .skill-card {
        height: 160px;
    }
    
    .skill-front i {
        font-size: 2.2rem;
    }
    
    .btn {
        padding: 14px 26px;
        font-size: 1rem;
        max-width: 280px;
    }
    
    .section-title {
        font-size: 2.1rem;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
    
    .profile-img {
        width: 300px;
        height: 300px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .project-card {
        min-height: 320px;
    }
    
    .project-image {
        height: 180px;
    }
    
    .project-icon {
        width: 100px;
        height: 100px;
    }
    
    .project-icon i {
        font-size: 2.8rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .skill-card {
        height: 190px;
    }
    
    .skill-front i {
        font-size: 2.8rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .profile-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .company-logo-img,
    .university-logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .project-card,
    .skill-card,
    .timeline-item,
    .education-card,
    .research-card {
        transition: none;
        animation: none;
    }
    
    .project-card:hover,
    .skill-card:hover,
    .timeline-content:hover,
    .education-card:hover,
    .research-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-link::after {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .project-card,
    .skill-card,
    .timeline-content,
    .education-card,
    .research-card {
        border-width: 2px;
        border-color: var(--red-primary);
    }
    
    .btn {
        border-width: 2px;
    }
    
    .nav-link::after {
        height: 3px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

/* Focus states for accessibility */
*:focus {
    outline: 2px solid var(--red-primary);
    outline-offset: 2px;
}

/* Smooth scrolling for all anchor links */
html {
    scroll-behavior: smooth;
}

/* Samsung-style section transitions */
section, .hero {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.section-hidden {
    opacity: 0.3;
    transform: translateY(50px);
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-down {
    animation: sectionSlideInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.scroll-up {
    animation: sectionSlideInDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes sectionSlideInUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sectionSlideInDown {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Element-level animations */
.animate-in-up {
    animation: elementSlideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-in-down {
    animation: elementSlideInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-out {
    animation: elementSlideOut 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes elementSlideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes elementSlideInDown {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes elementSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(3px);
    }
}

/* Enhanced project card animations */
.project-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card.animate-in-up,
.project-card.animate-in-down {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Skill card animations */
.skill-card {
    opacity: 0;
    transform: translateY(30px) rotateY(10deg);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.skill-card.animate-in-up,
.skill-card.animate-in-down {
    opacity: 1;
    transform: translateY(0) rotateY(0deg);
}

/* Stat animations */
.stat {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat.animate-in-up,
.stat.animate-in-down {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Text animations */
.about-text p,
.hero-text > * {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about-text p.animate-in-up,
.about-text p.animate-in-down,
.hero-text > *.animate-in-up,
.hero-text > *.animate-in-down {
    opacity: 1;
    transform: translateX(0);
}

/* Section title animations */
.section-title {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-title.animate-in-up,
.section-title.animate-in-down {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Contact item animations */
.contact-item {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-item.animate-in-up,
.contact-item.animate-in-down {
    opacity: 1;
    transform: translateX(0);
}

/* Loading animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Breathing animation for CTA buttons */
.btn-primary {
    animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Tech tags in modal */
.tech-tag {
    display: inline-block;
    background: var(--red-primary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 5px;
    transition: all var(--transition-fast);
}

.tech-tag:hover {
    background: var(--red-secondary);
    transform: translateY(-2px);
}

/* Skill card flip animation */
.skill-card.flipped .skill-front {
    transform: rotateY(180deg);
}

.skill-card.flipped .skill-back {
    transform: rotateY(0);
}

/* Page loading animation */
body {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* Smooth scrolling state */
body.smooth-scrolling section {
    transition-duration: 0.3s;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    section, .hero {
        transition: none;
        animation: none;
    }
    
    .animate-in-up,
    .animate-in-down,
    .animate-out {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
    
    .project-card,
    .skill-card,
    .stat,
    .about-text p,
    .hero-text > *,
    .section-title,
    .contact-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Enhanced mobile responsiveness for animations */
@media (max-width: 768px) {
    .section-hidden {
        transform: translateY(30px);
    }
    
    @keyframes sectionSlideInUp {
        from {
            opacity: 0;
            transform: translateY(30px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    @keyframes sectionSlideInDown {
        from {
            opacity: 0;
            transform: translateY(-30px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    @keyframes elementSlideInUp {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.95);
            filter: blur(2px);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }
    
    @keyframes elementSlideInDown {
        from {
            opacity: 0;
            transform: translateY(-20px) scale(0.95);
            filter: blur(2px);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }
}

/* Mobile optimizations */
.mobile-optimized .project-card {
    animation: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-optimized .project-card:hover {
    transform: translateY(-5px) scale(1.01);
}

.mobile-optimized .project-icon {
    transition: transform 0.3s ease;
}

.mobile-optimized .project-card:hover .project-icon {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Prevent animation conflicts during resize */
.projects-grid {
    transition: none;
}

.projects-grid * {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Ensure smooth transitions on mobile */
@media (max-width: 768px) {
    .project-card {
        will-change: transform;
        backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    .project-overlay {
        backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    .project-icon {
        backface-visibility: hidden;
        transform: translateZ(0) translate(-50%, -50%);
    }
}

/* Image loading animation */
img {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

img.loaded {
    opacity: 1;
} 

/* Smooth Page Transitions */
.page-transition {
  opacity: 0;
  animation: fadeIn 0.8s ease-in-out forwards;
}

.transitioning {
  pointer-events: none;
}

.transitioning * {
  transition: all 0.3s ease-in-out;
}

/* Enhanced smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Section transition animations */
section {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-in-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Intersection Observer for section animations */
.section-animate {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-in-out;
}

.section-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced button hover effects */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.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 0.5s ease;
}

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

/* Enhanced navigation transitions */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--red-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

/* Enhanced project card transitions */
.project-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Enhanced skill card transitions */
.skill-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover {
  transform: translateY(-5px) scale(1.05);
}

/* Timeline animations */
.timeline-item {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease-in-out;
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateX(0);
}

/* Education card animations */
.education-card {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-in-out;
}

.education-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Loading animation */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--black-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(230, 57, 70, 0.3);
  border-top: 3px solid var(--red-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* PWA Install prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black-primary);
  border: 1px solid var(--red-primary);
  border-radius: 10px;
  padding: 15px 20px;
  color: var(--white);
  font-size: 0.9rem;
  z-index: 1000;
  display: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.install-prompt.show {
  display: block;
  animation: slideInUp 0.3s ease;
}

.install-prompt button {
  background: var(--red-primary);
  color: var(--white);
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  margin-left: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.install-prompt button:hover {
  background: var(--red-secondary);
  transform: translateY(-2px);
}

/* Offline indicator */
.offline-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #dc2626;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 0.8rem;
  z-index: 1000;
  display: none;
}

.offline-indicator.show {
  display: block;
  animation: slideInRight 0.3s ease;
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .page-transition {
    opacity: 1;
    animation: none;
  }
  
  section {
    opacity: 1;
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --red-primary: #ff0000;
    --red-secondary: #cc0000;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .nav-link::after {
    height: 3px;
  }
}

/* CV Modal Styles */
.cv-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.cv-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(230, 57, 70, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.cv-modal-content .modal-header h2 {
    margin: 0;
    color: var(--white);
    font-size: 1.5rem;
}

.cv-actions {
    display: flex;
    gap: 10px;
}

.cv-actions .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.cv-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

#cv-iframe {
    border: none;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 0 0 15px 15px;
}

/* Responsive CV Modal */
@media (max-width: 768px) {
    .cv-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        width: 95vw;
        height: 90vh;
    }
    
    .cv-modal-content .modal-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .cv-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .cv-actions .btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cv-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .cv-modal-content .modal-header {
        padding: 10px 15px;
    }
    
    .cv-actions {
        flex-direction: column;
        gap: 8px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .back-to-top,
    .theme-toggle,
    .install-prompt,
    .offline-indicator {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero {
        background: white !important;
    }
    
    section {
        page-break-inside: avoid;
    }
} 

/* Animated Statistics */
.stat {
    position: relative;
    overflow: hidden;
}

.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--red-primary);
    transition: all 0.3s ease;
    display: inline-block;
}

.counter.animate {
    animation: counterPulse 0.6s ease-out;
}

@keyframes counterPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
} 

/* Research Section */
.research {
    padding: 80px 0;
    background: var(--dark-bg);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.research-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-primary), #ff6b6b);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.research-card:hover::before {
    transform: scaleX(1);
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.research-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.research-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--red-primary), #ff6b6b);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.research-details h3 {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
}

.research-date {
    color: var(--red-primary);
    font-weight: 600;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.research-institution {
    color: var(--text-secondary);
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.research-type {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
}

.research-authors {
    color: var(--text-secondary);
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    font-style: italic;
}

.research-content p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.research-abstract {
    margin-bottom: 25px;
}

.research-abstract h4 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.research-abstract p {
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 12px;
    text-align: justify;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.research-keywords {
    margin-bottom: 25px;
}

.research-keywords h4 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    background: var(--red-primary);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.keyword-tag:hover {
    background: var(--red-secondary);
    transform: translateY(-1px);
}

.research-highlights {
    margin-bottom: 25px;
}

.research-highlights h4 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.research-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.research-highlights li {
    color: var(--text-primary);
    padding: 8px 0;
    position: relative;
    padding-left: 20px;
    line-height: 1.5;
}

.research-highlights li::before {
    content: '•';
    color: var(--red-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 8px;
}

.research-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.research-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Light theme research styles */
[data-theme="light"] .research {
    background: #ffffff;
}

[data-theme="light"] .research-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .research-details h3 {
    color: #000000;
}

[data-theme="light"] .research-content p {
    color: #333333;
}

[data-theme="light"] .research-highlights h4 {
    color: #000000;
}

[data-theme="light"] .research-highlights li {
    color: #333333;
}

[data-theme="light"] .research-authors {
    color: #333333;
}

[data-theme="light"] .research-abstract h4 {
    color: #000000;
}

[data-theme="light"] .research-abstract p {
    color: #333333;
}

[data-theme="light"] .research-keywords h4 {
    color: #000000;
}

[data-theme="light"] .keyword-tag {
    background: var(--red-primary);
    color: var(--white);
}

[data-theme="light"] .keyword-tag:hover {
    background: var(--red-secondary);
}

/* Light theme research section title */
[data-theme="light"] .research .section-title {
    color: #000000;
}

[data-theme="light"] .research .section-title::after {
    background: var(--red-primary);
}

/* Additional light theme research styles for better visibility */
[data-theme="light"] .research-date {
    color: var(--red-primary);
}

[data-theme="light"] .research-institution {
    color: #666666;
}

[data-theme="light"] .research-type {
    color: #666666;
}

[data-theme="light"] .research-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

[data-theme="light"] .research-actions .btn-outline {
    border-color: var(--red-primary);
    color: var(--red-primary);
}

[data-theme="light"] .research-actions .btn-outline:hover {
    background: var(--red-primary);
    color: var(--white);
}

[data-theme="light"] .research-actions .btn-primary {
    background: var(--red-primary);
    color: var(--white);
}

[data-theme="light"] .research-actions .btn-primary:hover {
    background: var(--red-secondary);
}

/* Responsive research styles */
@media (max-width: 768px) {
    .research-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .research-card {
        padding: 25px;
    }
    
    .research-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .research-actions {
        flex-direction: column;
    }
    
    .research-actions .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .research-card {
        padding: 20px;
    }
    
    .research-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .research-details h3 {
        font-size: 1rem;
        line-height: 1.2;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .research-abstract p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
} 

/* Language Dropdown */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.lang-dropdown-btn.active {
    background: var(--red-primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.lang-dropdown-btn .flag {
    font-size: 1.1rem;
}

.lang-dropdown-btn .lang-text {
    font-weight: 600;
}

.lang-dropdown-btn i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.lang-dropdown-btn.active i {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
}

.lang-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
}

.lang-option:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 12px 12px;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
    background: var(--red-primary);
    color: var(--white);
}

.lang-option .flag {
    font-size: 1.1rem;
    min-width: 20px;
}

.lang-option .lang-text {
    font-weight: 500;
}

/* Light theme language dropdown styles */
[data-theme="light"] .lang-dropdown-btn {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    opacity: 1 !important;
}

[data-theme="light"] .lang-dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.15) !important;
    color: #000000 !important;
    opacity: 1 !important;
}

[data-theme="light"] .lang-dropdown-menu {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .lang-option {
    color: #000000;
}

[data-theme="light"] .lang-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .lang-option.active {
    background: var(--red-primary);
    color: var(--white);
}

/* Responsive language dropdown */
@media (max-width: 768px) {
    .lang-dropdown-menu {
        right: -20px;
        min-width: 140px;
    }
    
    .lang-option {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .lang-dropdown-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .lang-dropdown-menu {
        right: -10px;
        min-width: 120px;
    }
    
    .lang-option {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end;
}

.language-dropdown {
    margin-right: auto;
}

/* Light theme navigation controls */
[data-theme="light"] .nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end;
}

[data-theme="light"] .nav-controls .language-dropdown,
[data-theme="light"] .nav-controls .theme-toggle {
    visibility: visible;
    opacity: 1;
}

/* Ensure nav-logo is visible in light theme */
[data-theme="light"] .nav-logo a {
    color: var(--red-primary) !important;
}

[data-theme="light"] .nav-logo a:hover {
    color: var(--red-secondary) !important;
}

/* Ensure nav-container has proper background in light theme */
[data-theme="light"] .nav-container {
    background: transparent;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }
    
    .skill-card:hover .skill-front {
        transform: none;
    }
    
    .skill-card:hover .skill-back {
        transform: rotateY(180deg);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    /* Increase touch targets */
    .nav-link {
        padding: 12px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .social-link {
        min-width: 44px;
        min-height: 44px;
    }
    
    .lang-dropdown-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .lang-option {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .back-to-top {
        min-width: 48px;
        min-height: 48px;
    }
    
    .theme-toggle {
        min-width: 40px;
        min-height: 40px;
    }
    
    .modal-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improve scrolling on touch devices */
    .hero,
    section {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus */
    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }
}

/* Mobile Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
    
    .nav-container {
        padding-top: env(safe-area-inset-top);
    }
    
    .back-to-top {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .install-prompt {
        bottom: calc(15px + env(safe-area-inset-bottom));
    }
}

/* Mobile Chrome/Samsung Browser Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .project-card {
        will-change: transform;
        backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    .skill-card {
        will-change: transform;
        backface-visibility: hidden;
        transform: translateZ(0);
    }
}

/* Ensure proper viewport handling */
@media screen and (max-width: 480px) {
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    .nav-container {
        height: 70px;
        height: calc(70px + env(safe-area-inset-top));
    }
    
    .nav-menu {
        top: 70px;
        top: calc(70px + env(safe-area-inset-top));
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .project-card,
    .skill-card,
    .timeline-content,
    .education-card,
    .research-card {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Light mode support for mobile */
@media (prefers-color-scheme: light) {
    [data-theme="light"] .project-card,
    [data-theme="light"] .skill-card,
    [data-theme="light"] .timeline-content,
    [data-theme="light"] .education-card,
    [data-theme="light"] .research-card {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* Touch Device Specific Styles */
.touch-device .project-card:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.touch-device .skill-card:hover .skill-front {
    transform: none;
}

.touch-device .skill-card:hover .skill-back {
    transform: rotateY(180deg);
}

.touch-device .btn:hover {
    transform: none;
}

.touch-device .nav-link:hover::after {
    width: 0;
}

/* Mobile Safari Specific Styles */
.mobile-safari .hero {
    min-height: -webkit-fill-available;
}

.mobile-safari .nav-container {
    padding-top: env(safe-area-inset-top);
}

.mobile-safari .back-to-top {
    bottom: calc(20px + env(safe-area-inset-bottom));
}

.mobile-safari .install-prompt {
    bottom: calc(15px + env(safe-area-inset-bottom));
}

/* Enhanced Mobile Performance */
.mobile-optimized .project-card {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mobile-optimized .skill-card {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mobile-optimized .timeline-content,
.mobile-optimized .education-card,
.mobile-optimized .research-card {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Prevent text selection on mobile for better UX */
@media (max-width: 768px) {
    .project-card,
    .skill-card,
    .btn,
    .nav-link {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection in content areas */
    .about-text,
    .research-content,
    .education-content {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}

/* Enhanced Mobile Loading States */
@media (max-width: 768px) {
    .loading {
        background: var(--black-primary);
        backdrop-filter: blur(10px);
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
}

/* Mobile-specific focus states */
@media (max-width: 768px) {
    .btn:focus,
    .nav-link:focus,
    .project-card:focus,
    .skill-card:focus {
        outline: 2px solid var(--red-primary);
        outline-offset: 2px;
    }
    
    /* Remove focus outline for non-interactive elements */
    .project-image:focus,
    .skill-front:focus,
    .skill-back:focus {
        outline: none;
    }
}

/* Notification System Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--red-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--text-primary);
}

.notification-content i {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-success .notification-content i {
    color: #4CAF50;
}

.notification-error .notification-content i {
    color: var(--red-primary);
}

.notification-info .notification-content i {
    color: #2196F3;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.notification-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        animation: slideInTop 0.3s ease-out;
    }
    
    @keyframes slideInTop {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* Mobile responsive character counter */
@media (max-width: 768px) {
    .char-counter {
        right: 8px;
        bottom: 8px;
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}

/* Character Counter Styles */
.char-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 1;
    animation: fadeIn 0.3s ease-out;
    transform: scale(1);
}

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

.form-group {
    position: relative;
}

/* Removed conflicting label positioning */

/* Loading spinner styles */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn i.fa-spinner {
    margin-right: 8px;
}