/* Reset and Base Styles */
/* Normalize margins, padding, and box-sizing for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styling for body with font and transitions */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease, color 0.5s ease;
    /* Updated: Ensure minimum readability on small screens */
    font-size: clamp(12px, 2.5vw, 16px);
}

/* CSS Variables for Theming */
:root {
    /* Dark Theme Variables */
    --dark-bg: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #475569 100%);
    --dark-text: #F5F6F5;
    --dark-accent: #7C3AED;
    --dark-accent-hover: #A5B4FC;
    --dark-bg-secondary: rgba(30, 41, 59, 0.85);
    --dark-bg-overlay: rgba(15, 23, 42, 0.65);

    /* Light Theme Variables */
    --light-bg: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 50%, #D1D5DB 100%);
    --light-text: #2D3748;
    --light-accent: #059669;
    --light-accent-hover: #34D399;
    --light-bg-secondary: rgba(249, 250, 251, 0.9);
    --light-bg-overlay: rgba(229, 231, 235, 0.75);

    /* Neon Theme Variables */
    --neon-bg: linear-gradient(135deg, #0A0E14 0%, #1A2A44 50%, #2E5077 100%);
    --neon-text: #00FFAA;
    --neon-accent: #00FFAA;

    /* Violet Theme Variables */
    --violet-bg: linear-gradient(135deg, #2A1F5E 0%, #3D2C6B 50%, #6B4E99 100%);
    --violet-text: #D4A4EB;
    --violet-accent: #D4A4EB;

    /* Cyan Theme Variables */
    --cyan-bg: linear-gradient(135deg, #0D2E3A 0%, #1D4D6A 50%, #43A8A8 100%);
    --cyan-text: #A3E4D7;
    --cyan-accent: #43A8A8;

    /* Emerald Theme Variables */
    --emerald-bg: linear-gradient(135deg, #022C22 0%, #064E3B 50%, #10B981 100%);
    --emerald-text: #ECFDF5;
    --emerald-accent: #047857;
    --emerald-accent-hover: #34D399;

    /* Sunset Theme Variables */
    --sunset-bg: linear-gradient(135deg, #7C2D12 0%, #EA580C 50%, #A21CAF 100%);
    --sunset-text: #4B5563;
    --sunset-accent: #F97316;
    --sunset-accent-hover: #FBBF24;

    /* Midnight Theme Variables */
    --midnight-bg: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4C1D95 100%);
    --midnight-text: #F1F5F9;
    --midnight-accent: #60A5FA;
    --midnight-accent-hover: #93C5FD;

    /* Shared Variables */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 5px 20px rgba(107, 78, 153, 0.4);
    --shadow-lg: 0 10px 30px rgba(107, 78, 153, 0.6);
    --border-radius: 15px;
    --transition-base: all 0.3s ease;
}

/* Theme Classes */
body.dark-mode { background: var(--dark-bg); color: var(--dark-text); --accent-color: var(--dark-accent); --accent-hover: var(--dark-accent-hover); --bg-secondary: var(--dark-bg-secondary); --bg-overlay: var(--dark-bg-overlay); }
body.light-mode { background: var(--light-bg); color: var(--light-text); --accent-color: var(--light-accent); --accent-hover: var(--light-accent-hover); --bg-secondary: var(--light-bg-secondary); --bg-overlay: var(--light-bg-overlay); }
body.neon-mode { background: var(--neon-bg); color: var(--neon-text); --accent-color: var(--neon-accent); --accent-hover: var(--neon-text); background-size: 200% 200%; animation: neonBackground 10s ease infinite; }
body.violet-mode { background: var(--violet-bg); color: var(--violet-text); --accent-color: var(--violet-accent); --accent-hover: var(--violet-text); background-size: 200% 200%; animation: violetBackground 12s ease infinite; }
body.cyan-mode { background: var(--cyan-bg); color: var(--cyan-text); --accent-color: var(--cyan-accent); --accent-hover: var(--cyan-text); background-size: 200% 200%; animation: cyanBackground 15s ease infinite; }
body.emerald-mode { background: var(--emerald-bg); color: var(--emerald-text); --accent-color: var(--emerald-accent); --accent-hover: var(--emerald-accent-hover); background-size: 200% 200%; animation: emeraldBackground 10s ease infinite; }
body.sunset-mode { background: var(--sunset-bg); color: var(--sunset-text); --accent-color: var(--sunset-accent); --accent-hover: var(--sunset-accent-hover); background-size: 200% 200%; animation: sunsetBackground 16s ease infinite; }
body.midnight-mode { background: var(--midnight-bg); color: var(--midnight-text); --accent-color: var(--midnight-accent); --accent-hover: var(--midnight-accent-hover); background-size: 200% 200%; animation: midnightBackground 13s ease infinite; }

/* Animations */
@keyframes neonBackground { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
@keyframes violetBackground { 0% { background-position: 0% 0%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 0%; } }
@keyframes cyanBackground { 0% { background-position: 0% 0%; } 50% { background-position: 50% 100%; } 100% { background-position: 0% 0%; } }
@keyframes emeraldBackground { 0% { background-position: 0% 0%; } 50% { background-position: 100% 75%; } 100% { background-position: 0% 0%; } }
@keyframes sunsetBackground { 0% { background-position: 0% 0%; } 50% { background-position: 75% 100%; } 100% { background-position: 0% 0%; } }
@keyframes midnightBackground { 0% { background-position: 0% 0%; } 50% { background-position: 100% 25%; } 100% { background-position: 0% 0%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes glow { from { text-shadow: 0 0 5px var(--accent-color); } to { text-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes modalOpen { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes titleSlide { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes burgerOpen { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }

/* Matrix Rain Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0F172A;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--accent-color);
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Navigation Styles */
nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    height: 60px;
    transition: background 0.5s ease;
}

/* Theme-Specific Nav Backgrounds */
body.light-mode nav { background: rgba(249, 250, 251, 0.95); }
body.emerald-mode nav { background: rgba(4, 78, 59, 0.95); }
body.sunset-mode nav { background: rgba(234, 88, 12, 0.95); }
body.midnight-mode nav { background: rgba(49, 46, 129, 0.95); }

/* Burger Menu */
.burger-menu {
    display: none; /* Hidden by default on desktop */
    font-size: 1.5rem;
    color: var(--accent-color);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.burger-menu.active { animation: burgerOpen 0.3s forwards; }

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    transition: all 0.3s ease; /* Smooth transition for mobile */
}

nav ul li { margin: 0 15px; }

nav ul li a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1em;
    transition: var(--transition-base);
}

nav ul li a:hover {
    color: var(--accent-hover);
    transform: translateY(-2px);
}

nav ul li a.active {
    color: var(--accent-hover);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-hover);
    padding-bottom: 2px;
}

nav ul li a:focus {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
}

/* Theme Switcher */
.theme-switcher {
    position: absolute;
    top: 10px;
    right: 20px;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--accent-color);
    padding: 8px 12px;
    border-radius: 50%;
    transition: var(--transition-base);
    box-shadow: var(--shadow-md);
}

#theme-toggle:hover {
    transform: scale(1.2);
    background: rgba(165, 180, 252, 0.2);
    color: var(--accent-hover);
}

body.light-mode #theme-toggle:hover { background: rgba(52, 211, 153, 0.2); }
body.emerald-mode #theme-toggle:hover { background: rgba(4, 120, 87, 0.2); }
body.sunset-mode #theme-toggle:hover { background: rgba(249, 115, 22, 0.2); }
body.midnight-mode #theme-toggle:hover { background: rgba(96, 165, 250, 0.2); }

/* Hero Section */
.hero {
    padding: 15px;
    text-align: center;
    margin-top: 70px;
    padding-bottom: 40px;
    animation: fadeInUp 1s ease-out;
    opacity: 0; /* For fade-in on load */
}

.hero.visible { opacity: 1; }

.hero-content {
    padding: 20px;
    background: var(--bg-overlay);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    margin-bottom: 15px;
    transition: var(--transition-base);
    animation: bounceIn 1s ease-out;
}

.profile-pic:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(107, 78, 153, 0.5);
}

.hero h1 {
    font-size: 2.3em;
    margin-bottom: 10px;
    animation: slideInLeft 1s ease-out;
}

.hero span { color: var(--accent-color); }

.subtitle {
    font-size: 1.05em;
    color: #93C5FD;
    margin-bottom: 8px;
    animation: fadeIn 2s ease-in-out forwards;
}

body.light-mode .subtitle { color: #4B5EAA; }
body.emerald-mode .subtitle { color: #34D399; }
body.sunset-mode .subtitle { color: #FBBF24; }
body.midnight-mode .subtitle { color: #93C5FD; }

#typing-text {
    font-size: 1.15em;
    color: #BFCDE0;
    margin-bottom: 18px;
    max-width: 500px;
    animation: fadeIn 1.5s ease-out;
    /* Updated: Prevent overflow on small screens */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-mode #typing-text { color: #4A5568; }
body.emerald-mode #typing-text { color: #D1FAE5; }
body.sunset-mode #typing-text { color: #9CA3AF; }
body.midnight-mode #typing-text { color: #CBD5E1; }

.cta-button {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition-base);
    animation: zoomIn 1s ease-out;
    /* Updated: Ensure touch-friendly size */
    padding: 12px 24px;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

body.sunset-mode .cta-button:hover { background: linear-gradient(to right, #F97316, #FBBF24); }

.social-icons { margin-top: 12px; }

.social-icons a {
    color: var(--accent-color);
    font-size: 1.45em;
    margin: 0 9px;
    transition: var(--transition-base);
    animation: fadeIn 1.5s ease-out;
}

.social-icons a:hover {
    color: var(--accent-hover);
    transform: translateY(-5px);
}

/* About Section */
.about {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 40px;
    animation: fadeInUp 1s ease-out;
    opacity: 0;
}

.about.visible { opacity: 1; }

.about-container {
    max-width: 800px;
    width: 90%;
    text-align: center;
}

.about-title {
    font-size: 2.5em;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(107, 78, 153, 0.7);
    animation: glow 1.5s ease-in-out infinite alternate;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.about-title.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-timeline { position: relative; padding: 20px 0; }

.about-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-color), var(--accent-hover));
    /* Updated: Precise centering */
    transform: translateX(calc(-50% - 1px));
}

.timeline-item {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.active {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border: 3px solid var(--accent-hover);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    transition: var(--transition-base);
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 15px rgba(107, 78, 153, 0.8);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    transition: var(--transition-base);
    backdrop-filter: blur(5px);
}

.timeline-item:nth-child(odd) .timeline-content { transform: translateX(-60%); }
.timeline-item:nth-child(even) .timeline-content { transform: translateX(60%); }

.timeline-item:hover .timeline-content {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
}

.timeline-content h3 {
    font-size: 1.2em;
    color: var(--accent-color);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--accent-hover);
    padding-bottom: 5px;
}

.timeline-content p { font-size: 0.9em; color: #BFCDE0; line-height: 1.5; }

body.light-mode .timeline-content p { color: #4A5568; }
body.emerald-mode .timeline-content p { color: #D1FAE5; }
body.sunset-mode .timeline-content p { color: #9CA3AF; }
body.midnight-mode .timeline-content p { color: #CBD5E1; }

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.skills-list li {
    background: #1E293B;
    padding: 6px 10px;
    border: 2px solid var(--accent-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    transition: var(--transition-base);
    animation: fadeIn 1s ease-out;
}

body.light-mode .skills-list li { background: #E5E7EB; }
body.emerald-mode .skills-list li { background: #064E3B; }
body.sunset-mode .skills-list li { background: #EA580C; }
body.midnight-mode .skills-list li { background: #312E81; }

.skills-list li:hover {
    transform: translateY(-3px);
    background: #475569;
}

body.light-mode .skills-list li:hover { background: #D1D5DB; }
body.emerald-mode .skills-list li:hover { background: #10B981; }
body.sunset-mode .skills-list li:hover { background: #F97316; }
body.midnight-mode .skills-list li:hover { background: #4C1D95; }

.skills-list i { color: var(--accent-hover); }

/* Projects Section */
.projects {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 40px;
    animation: fadeInUp 1s ease-out;
    opacity: 0;
}

.projects.visible { opacity: 1; }

.projects-container {
    max-width: 1200px;
    width: 90%;
    text-align: center;
}

.projects-title {
    font-size: 2.5em;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(107, 78, 153, 0.7);
    animation: glow 1.5s ease-in-out infinite alternate;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.projects-title.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Updated: Use CSS Grid for better mobile responsiveness */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Auto-fit for mobile */
    gap: 15px;
    justify-content: center;
}

.project-card {
    height: 400px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--accent-color);
    transition: var(--transition-base);
    animation: fadeIn 1s ease-out;
    /* Ensure card fits within grid */
    max-width: 100%;
}

.project-card:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 0 20px var(--accent-hover);
    border-color: var(--accent-hover);
}

.project-card img {
    width: 100%;
    height: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* New: Prevent image overflow on mobile */
    max-height: 200px;
}

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

.card-content { padding: 10px; text-align: center; }

.card-content h3 {
    font-size: 1.3em;
    color: var(--accent-color);
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(107, 78, 153, 0.3);
}

.card-content p { font-size: 0.9em; color: #BFCDE0; line-height: 1.5; margin-bottom: 8px; }

body.light-mode .card-content p { color: #4A5568; }
body.emerald-mode .card-content p { color: #D1FAE5; }
body.sunset-mode .card-content p { color: #9CA3AF; }
body.midnight-mode .card-content p { color: #CBD5E1; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.tags span {
    background: #1E293B;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8em;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    flex-direction: column;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: var(--border-radius);
    animation: modalOpen 0.5s ease;
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--accent-color);
    position: relative;
    margin: auto;
}

body.midnight-mode .modal-content { box-shadow: 0 0 10px rgba(96, 165, 250, 0.5); }

.modal-content h2 {
    font-size: 1.8em;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 20px;
}

.modal-content p { font-size: 1em; color: #BFCDE0; margin-bottom: 20px; }

body.light-mode .modal-content p { color: #4A5568; }
body.emerald-mode .modal-content p { color: #D1FAE5; }
body.sunset-mode .modal-content p { color: #9CA3AF; }
body.midnight-mode .modal-content p { color: #CBD5E1; }

.modal-content .cta-button { margin: 10px; display: inline-block; }

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover { color: var(--accent-hover); }

/* Contact Section */
.contact {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 40px;
    animation: fadeInUp 1s ease-out;
    opacity: 0;
}

.contact.visible { opacity: 1; }

.contact-title {
    font-size: 2.5em;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(107, 78, 153, 0.7);
    animation: glow 1.5s ease-in-out infinite alternate;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-title.visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    width: 90%;
    gap: 20px;
}

.contact-info, .contact-form {
    flex: 1;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow-md);
    animation: fadeIn 1.5s ease-out;
}

.info-item { display: flex; align-items: center; margin-bottom: 15px; }

.info-item i { margin-right: 10px; color: var(--accent-color); font-size: 1.2em; }

.info-item a { color: var(--accent-color); text-decoration: none; transition: color 0.3s ease; }

.info-item a:hover { color: var(--accent-hover); }

.resume-download .cta-button { padding: 8px 15px; display: flex; align-items: center; gap: 6px; }

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #475569;
    background: #1E293B;
    color: var(--dark-text);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

body.light-mode .contact-form input, body.light-mode .contact-form textarea { border: 1px solid #D1D5DB; background: #E5E7EB; color: var(--light-text); }
body.emerald-mode .contact-form input, body.emerald-mode .contact-form textarea { border: 1px solid #047857; background: #064E3B; color: var(--emerald-text); }
body.sunset-mode .contact-form input, body.sunset-mode .contact-form textarea { border: 1px solid #F97316; background: #EA580C; color: var(--sunset-text); }
body.midnight-mode .contact-form input, body.midnight-mode .contact-form textarea { border: 1px solid #60A5FA; background: #312E81; color: var(--midnight-text); }

.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent-color); outline: none; }

.contact-form textarea { height: 120px; resize: none; }

.submit-button {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: var(--transition-base);
}

.submit-button:hover { background: var(--accent-hover); transform: translateY(-3px); }

body.sunset-mode .submit-button:hover { background: linear-gradient(to right, #F97316, #FBBF24); }

.error { color: #F87171; font-size: 0.9em; display: block; margin-top: -5px; margin-bottom: 8px; }

/* Footer */
footer {
    text-align: center;
    padding: 15px 0;
    background: #1E293B;
    width: 100%;
    position: relative;
    z-index: 2;
    animation: fadeIn 1.5s ease-out;
}

body.light-mode footer { background: #D1D5DB; }
body.emerald-mode footer { background: #064E3B; }
body.sunset-mode footer { background: #EA580C; }
body.midnight-mode footer { background: #312E81; }

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.9em;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition-base);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1.5s ease-out;
}

#back-to-top:hover { background: var(--accent-hover); transform: translateY(-3px); }

body.sunset-mode #back-to-top:hover { background: linear-gradient(to right, #F97316, #FBBF24); }

/* Responsive Design */
/* Media query for tablets and smaller screens */
@media (max-width: 768px) {
    .burger-menu { display: block; padding: 10px; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        padding: 20px 0;
        /* Updated: Smooth height transition */
        height: auto;
    }
    .nav-links.active { display: flex; }
    nav ul li { margin: 10px 0; }
    .theme-switcher { right: 50px; }
    .hero { margin-top: 50px; padding: 15px; }
    .hero-content { width: 95%; padding: 15px; }
    .hero h1 { font-size: 1.8em; }
    .subtitle, .hero p { font-size: 0.9em; }
    #typing-text { max-width: 250px; font-size: 0.8em; }
    .profile-pic { width: min(120px, 40vw); height: min(120px, 40vw); } /* Updated: Scale dynamically */
    .about, .projects, .contact { padding: 30px 15px; }
    .about-title, .projects-title, .contact-title { font-size: 2em; margin-bottom: 20px; }
    /* New: Adjust timeline for mobile */
    .about-timeline::before { left: 15px; }
    .timeline-dot { left: 15px; }
    .timeline-item { flex-direction: column; align-items: flex-start; }
    .timeline-content { transform: translateX(0); max-width: 100%; margin-left: 25px; padding: 10px; }
    /* New: Adjust projects grid for mobile */
    .project-card { height: 350px; max-width: 100%; }
    .project-card img { max-height: 180px; }
    .contact-container { flex-direction: column; gap: 15px; }
    .contact-info, .contact-form { width: 100%; max-width: 400px; padding: 15px; }
    #back-to-top { bottom: 10px; right: 10px; width: 35px; height: 35px; font-size: 0.8em; }
}

/* New: Media query for very small screens (e.g., OnePlus 6T ~ 360px) */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.5em; }
    .subtitle { font-size: 0.85em; }
    #typing-text { font-size: 0.7em; max-width: 200px; }
    .profile-pic { width: min(100px, 35vw); height: min(100px, 35vw); }
    .about-title, .projects-title, .contact-title { font-size: 1.8em; }
    .about-timeline { position: relative; padding: 20px 0; }
    .about-timeline::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: linear-gradient(to bottom, var(--accent-color), var(--accent-hover));
    }
    .timeline-item {
        margin: 20px 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        opacity: 0;
        transform: translateY(50px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    .timeline-item.active {
        opacity: 1;
        transform: translateY(0);
    }
    .timeline-dot {
        width: 16px;
        height: 16px;
        background: var(--accent-color);
        border: 3px solid var(--accent-hover);
        border-radius: 50%;
        position: absolute;
        left: 15px;
        top: -8px;
        transform: translateX(0);
        transition: var(--transition-base);
    }
    .timeline-item:hover .timeline-dot {
        transform: scale(1.3);
        box-shadow: 0 0 15px rgba(107, 78, 153, 0.8);
    }
    .timeline-content {
        background: var(--bg-secondary);
        padding: 15px;
        border-radius: 10px;
        width: 80%;
        margin-left: 30px;
        margin-top: 15px;
        transition: var(--transition-base);
        backdrop-filter: blur(5px);
    }
    .timeline-content h3 {
        font-size: 1.2em;
        color: var(--accent-color);
        margin-bottom: 8px;
        border-bottom: 1px solid var(--accent-hover);
        padding-bottom: 5px;
    }
    .timeline-content p { font-size: 0.9em; color: #BFCDE0; line-height: 1.5; }
    body.light-mode .timeline-content p { color: #4A5568; }
    body.emerald-mode .timeline-content p { color: #D1FAE5; }
    body.sunset-mode .timeline-content p { color: #9CA3AF; }
    body.midnight-mode .timeline-content p { color: #CBD5E1; }
    .timeline-item:nth-child(odd) .timeline-content { transform: translateX(0); }
    .timeline-item:nth-child(even) .timeline-content { transform: translateX(0); }
    .timeline-item:hover .timeline-content {
        transform: translateX(0);
        box-shadow: var(--shadow-md);
    }
    .skills-list {
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }
    .project-card { height: 300px; }
    .project-card img { max-height: 150px; }
    .card-content h3 { font-size: 1.1em; }
    .card-content p { font-size: 0.75em; }
    .modal-content { padding: 20px; max-width: 90%; }
    .modal-content img { height: 200px; }
    .contact-form input, .contact-form textarea { font-size: 0.9em; }
}

/* Updated: Mid-range tweak for two-column projects */
@media (min-width: 600px) and (max-width: 768px) {
    .project-card { flex: 0 0 calc(50% - 15px); }
}

@media (min-width: 2560px) {
    .hero-content, .about-container, .projects-container, .contact-container { max-width: 1600px; }
    .project-card { flex: 0 0 400px; height: 500px; }
    .hero h1 { font-size: 3em; }
    .subtitle, #typing-text { font-size: 1.5em; }
    /* Updated: Better spacing and padding */
    nav ul li { margin: 0 clamp(15px, 2vw, 30px); }
    .hero-content { padding: 40px; }
}