:root {
    /* Modern 2026 Palette - Deep indigo with electric accents */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    /* Cyan for electric accents */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --background-color: #f8fafc;
    --text-color: #0f172a;
    /* Darker for better contrast */
    --light-text: #64748b;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1), 0 2px 4px -2px rgba(99, 102, 241, 0.1);
    --shadow-hover: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-slow: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Dark Mode Preference Support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #818cf8;
        --primary-dark: #6366f1;
        --secondary-color: #a78bfa;
        --accent-color: #22d3ee;
        --background-color: #0f172a;
        --text-color: #f1f5f9;
        --light-text: #94a3b8;
        --card-bg: rgba(30, 41, 59, 0.8);
        --glass-bg: rgba(30, 41, 59, 0.6);
        --glass-border: rgba(71, 85, 105, 0.4);
        --white: #1e293b;
    }
}

/* Manual Dark Mode Toggle */
:root[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #a78bfa;
    --accent-color: #22d3ee;
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --light-text: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.8);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(71, 85, 105, 0.4);
    --white: #1e293b;
}

:root[data-theme="light"] {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --background-color: #f8fafc;
    --text-color: #0f172a;
    --light-text: #64748b;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
}

/* Modern Keyframe Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes scale-in {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-up {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes typing-cursor {
    0%, 100% { border-color: var(--primary-color); }
    50% { border-color: transparent; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

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

.highlight {
    color: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

.alt-bg {
    background-color: var(--white);
}

/* Navbar - Glassmorphism */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

header.scrolled {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.12) 0%, 
        rgba(139, 92, 246, 0.08) 50%, 
        rgba(6, 182, 212, 0.06) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 
        0 4px 30px rgba(99, 102, 241, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

/* Dark mode scrolled header */
:root[data-theme="dark"] header.scrolled {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.15) 0%, 
        rgba(139, 92, 246, 0.12) 50%, 
        rgba(6, 182, 212, 0.08) 100%);
    border-bottom: 1px solid rgba(129, 140, 248, 0.2);
    box-shadow: 
        0 4px 30px rgba(99, 102, 241, 0.15),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease infinite;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links li a {
    font-weight: 500;
    color: var(--light-text);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a.active {
    color: var(--primary-color);
}

.nav-links li a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    margin: -0.5rem;
}

.hamburger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: var(--transition);
}

/* Hero Section - Modern Redesign */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--background-color) 0%, rgba(99, 102, 241, 0.03) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite reverse;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 4rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-text {
    text-align: left;
    z-index: 10;
}

.hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero-text .tagline {
    font-size: 1.5rem;
    color: var(--light-text);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Typing cursor effect */
.typing-text {
    display: inline;
    border-right: 3px solid var(--primary-color);
    padding-right: 5px;
    animation: typing-cursor 1s infinite;
}

.hero-text .bio-brief {
    font-size: 1.1rem;
    color: var(--light-text);
    margin-bottom: 2.5rem;
    max-width: 90%;
    line-height: 1.8;
}

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

.hero-text .cta-buttons {
    justify-content: flex-start;
}

/* Right Side Image Styling - Modern */
.hero-image-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.image-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 40%, transparent 70%);
    z-index: -1;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 8s ease-in-out infinite;
    filter: blur(40px);
}

.hero-profile-img {
    max-width: 100%;
    max-height: 650px;
    object-fit: cover;
    border-radius: 24px;
    position: relative;
    
    /* Soft vignette mask */
    mask-image: radial-gradient(ellipse 80% 90% at center, black 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at center, black 50%, transparent 100%);
    
    /* Subtle artistic treatment */
    filter: grayscale(30%) contrast(1.05);
    transition: var(--transition-slow);
    animation: scale-in 1s ease-out;
}

.hero-profile-img:hover {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.02) translateY(-5px);
    mask-image: radial-gradient(ellipse 85% 95% at center, black 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 85% 95% at center, black 60%, transparent 100%);
}

/* Button Styles - Modern with Gradient */
.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.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: var(--transition);
}

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

.primary-btn {
    background: var(--accent-gradient);
    background-size: 200% 200%;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* About Section - Glassmorphism Cards */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.education-card,
.skills-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.education-card::before,
.skills-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.education-card:hover,
.skills-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.education-card:hover::before,
.skills-card:hover::before {
    opacity: 1;
}

.education-card h3,
.skills-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.education-card h3 i,
.skills-card h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.timeline-item {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid transparent;
    border-image: var(--accent-gradient) 1;
    position: relative;
    transition: var(--transition);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-item:hover {
    padding-left: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.date {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.gpa {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.skills-category {
    margin-bottom: 1.5rem;
}

.skills-category:last-child {
    margin-bottom: 0;
}

.skills-category h4 {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: var(--transition);
    cursor: default;
}

.tags span:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Services Section - Modern Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-card:hover::before {
    opacity: 0.03;
}

.service-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: var(--transition);
}

.service-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--light-text);
    line-height: 1.7;
}

/* Portfolio Section - Modern Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

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

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.project-card:hover .project-info h3 {
    color: var(--primary-color);
}

.project-role {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}

.project-desc {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.7;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tech-stack span {
    font-size: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-weight: 500;
    transition: var(--transition);
}

.tech-stack span:hover {
    background: var(--primary-color);
    color: white;
    border-color: transparent;
}

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

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.05);
    transition: var(--transition);
}

.link-btn:hover {
    color: white;
    background: var(--primary-color);
    transform: translateX(3px);
}

/* Contact Section - Modern Design */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.contact-card {
    height: 100%;
}

.contact-info {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

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

.contact-desc {
    color: var(--light-text);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(5px);
}

.contact-item a {
    color: var(--text-color);
    font-weight: 500;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-item i {
    background: var(--accent-gradient);
    color: white;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 1rem;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.social-links a {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: white;
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Contact Form - Modern */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--light-text);
}

.full-width {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Form Error & Status Messages */
.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 1.25rem;
    display: block;
    margin-top: 0.25rem;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.form-status {
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.form-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Footer - Modern */
footer {
    background: linear-gradient(135deg, var(--text-color) 0%, #1e293b 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

footer p {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Large Tablets & Small Laptops */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .hero-container {
        gap: 3rem;
    }
    
    .hero-text h1 {
        font-size: 3.5rem;
    }
}

/* Tablets */
@media (max-width: 968px) {
    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 4rem 0;
    }

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

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

    .hero-text {
        text-align: center;
        order: 1;
    }

    .hero-image-wrapper {
        order: 2;
        justify-content: center;
    }

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

    .hero-text h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero-text .tagline {
        font-size: 1.25rem;
    }

    .hero-text .bio-brief {
        margin: 0 auto 2rem;
        max-width: 100%;
    }

    .hero-profile-img {
        max-height: 400px;
    }

    /* Mobile Navigation */
    .hamburger {
        display: block;
        z-index: 1001;
        padding: 0.5rem;
        margin: -0.5rem;
        /* Larger touch target */
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: var(--white);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        text-align: center;
        transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding-top: 5rem;
        z-index: 1000;
        gap: 0;
    }

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

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    }

    .nav-links li a {
        display: block;
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        /* Larger touch target */
    }

    .nav-links li a::after {
        display: none;
    }

    /* Cards Grid */
    .about-grid,
    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

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

    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }

    /* Card tilt disabled on touch devices */
    .service-card,
    .project-card,
    .education-card,
    .skills-card {
        transform: none !important;
    }
}

/* Small Tablets & Large Phones */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 3rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text .tagline {
        font-size: 1.1rem;
    }

    .hero-profile-img {
        max-height: 300px;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        /* Minimum touch target 44px */
        min-height: 48px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .education-card,
    .skills-card,
    .service-card,
    .project-card {
        padding: 1.75rem;
    }

    .contact-info,
    .contact-form {
        padding: 1.75rem;
    }

    .tags span {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .timeline-item {
        padding-left: 1rem;
    }

    .social-links a {
        width: 48px;
        height: 48px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    section {
        padding: 3rem 0;
    }

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

    .navbar {
        padding: 0.875rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-text .tagline {
        font-size: 1rem;
    }

    .hero-text .bio-brief {
        font-size: 0.95rem;
    }

    .hero-profile-img {
        max-height: 250px;
    }

    .image-blob {
        width: 300px;
        height: 300px;
    }

    .education-card h3,
    .skills-card h3,
    .service-card h3,
    .project-info h3 {
        font-size: 1.1rem;
    }

    .service-card .icon {
        font-size: 2.25rem;
    }

    .project-card {
        border-radius: 16px;
    }

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

    .contact-info h3 {
        font-size: 1.5rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    footer {
        padding: 2rem 1rem;
    }

    footer p {
        font-size: 0.85rem;
    }
}

/* Extra Small Phones */
@media (max-width: 360px) {
    .hero-text h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .tags {
        gap: 0.35rem;
    }

    .tags span {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 2rem;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .hero-text {
        text-align: left;
    }

    .hero-text .cta-buttons {
        justify-content: flex-start;
    }

    .hero-image-wrapper {
        order: 2;
    }

    .hero-profile-img {
        max-height: 50vh;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 4rem;
        gap: 0;
    }

    .nav-links li {
        width: auto;
        border-bottom: none;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .typing-text {
        border-right: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #4338ca;
        --text-color: #000000;
        --light-text: #374151;
        --card-bg: #ffffff;
        --glass-border: #000000;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .tags span {
        border: 1px solid var(--primary-color);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects that don't work well on touch */
    .service-card:hover,
    .project-card:hover,
    .education-card:hover,
    .skills-card:hover {
        transform: none;
    }

    .hero-profile-img:hover {
        transform: none;
        filter: grayscale(30%) contrast(1.05);
    }

    /* Increase tap targets */
    .nav-links li a,
    .link-btn,
    .social-links a,
    .contact-item {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Remove parallax on touch */
    .parallax-bg {
        transform: none;
    }
}

/* Advanced Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    filter: blur(8px);
    will-change: transform, opacity, filter;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Staggered animations with increasing delays */
.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 300ms; }
.stagger-4 { transition-delay: 400ms; }
.stagger-5 { transition-delay: 500ms; }

/* Alternative reveal directions */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Parallax Wrapper for Hero */
.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Gradient Text for Header */
h1 {
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease infinite;
}

/* Section title gradient on hover */
.section-title {
    transition: var(--transition);
}

.section-title:hover {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--light-text);
    font-size: 0.85rem;
    animation: float 2s ease-in-out infinite;
}

.scroll-indicator i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Custom selection */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Page load animation */
body {
    opacity: 1;
    transition: opacity 0.3s ease;
}

body:not(.loaded) .reveal,
body:not(.loaded) .reveal-left,
body:not(.loaded) .reveal-right {
    opacity: 0;
}

/* Card tilt effect override - smooth transition back */
.service-card,
.project-card,
.education-card,
.skills-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Gradient border effect for special elements */
.gradient-border {
    position: relative;
    background: var(--card-bg);
    border-radius: 20px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: var(--accent-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Pulse animation for interactive elements */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse-hover:hover {
    animation: pulse 1s ease infinite;
}

/* Glow effect */
.glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Text gradient utility */
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== THEME TOGGLE BUTTON ========== */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========== THEME TOGGLE SWITCH ========== */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-icon-light,
.theme-icon-dark {
    font-size: 0.9rem;
    color: var(--light-text);
    transition: var(--transition);
}

.theme-icon-light {
    color: #f59e0b;
}

.theme-icon-dark {
    color: var(--light-text);
}

:root[data-theme="dark"] .theme-icon-light {
    color: var(--light-text);
}

:root[data-theme="dark"] .theme-icon-dark {
    color: #818cf8;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    /* Better touch support */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.theme-switch input {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    /* Ensure input covers the entire switch for better tap area */
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transition: var(--transition);
    border-radius: 26px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:focus-visible + .slider {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Theme transition for smooth color changes */
body,
body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== COPY BUTTON ========== */
.copy-btn {
    background: rgba(99, 102, 241, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.copy-btn.copied {
    background: #10b981;
    color: white;
}

.copy-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Update contact item to accommodate copy button */
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: var(--transition);
    flex-wrap: wrap;
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ========== RESUME DOWNLOAD BUTTON ========== */
.resume-btn {
    background: transparent;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.resume-btn:hover {
    background: var(--primary-color);
    color: white;
    border-style: solid;
    transform: translateY(-3px);
}

.resume-btn i {
    transition: var(--transition);
}

.resume-btn:hover i {
    animation: bounce 0.5s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ========== PROJECT IMAGE PREVIEWS ========== */
.project-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.view-project {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transform: translateY(20px);
    transition: var(--transition);
}

.project-card:hover .view-project {
    transform: translateY(0);
}

.view-project:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Placeholder for missing project images */
.project-image img[src*="placeholder"],
.project-image img:not([src]),
.project-image img[src=""] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* ========== ANIMATED SKILL BARS ========== */
.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skill-item {
    width: 100%;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.skill-percent {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    width: 0;
    background: var(--accent-gradient);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.skill-progress.animated {
    animation: gradient-shift 3s ease infinite;
}

/* Skill bars animation trigger when visible */
.skills-card.visible .skill-progress {
    width: var(--progress);
}

/* ========== MOBILE ADJUSTMENTS FOR NEW FEATURES ========== */
@media (max-width: 768px) {
    .nav-actions {
        gap: 0.75rem;
    }
    
    .theme-switch-wrapper {
        display: flex;
    }
    
    .theme-switch {
        width: 44px;
        height: 24px;
        min-width: 44px;
        min-height: 24px;
    }
    
    .slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    .theme-icon-light,
    .theme-icon-dark {
        font-size: 0.85rem;
    }
    
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resume-btn {
        justify-content: center;
    }
    
    .project-image {
        height: 180px;
    }
    
    .skill-bar {
        height: 8px;
    }
}

@media (max-width: 480px) {
    .theme-switch-wrapper {
        gap: 0.3rem;
    }
    
    .theme-switch {
        width: 40px;
        height: 22px;
        min-width: 40px;
        min-height: 22px;
    }
    
    .slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(18px);
    }
    
    .theme-icon-light,
    .theme-icon-dark {
        font-size: 0.8rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
    
    .project-image {
        height: 160px;
    }
}