/* GLOBAL STYLES */
:root {
    --primary-color: #f5f5f5;
    --text-color: #2d3748;
    --accent-color: #3182ce;
    --accent-hover: #2b6cb0;
    --highlight-lightred: #f74646;
    --highlight-indigo: #6366f1;
    --highlight-dark-indigo: #4f46e5;
    --highlight-date: #000000;
    --highlight-date-dark: #ffffff;
    --highlight-lightteal: #94f1e5;
    --highlight-teal: #2dd4bf;
    --highlight-darkteal: #1e756a;
    --tagline-color: #3182ce;
    --tagline-dark: #528efd;
    --background-color: #ffffff;
    --background-color-header: #000000;
    --color-header: #fff;
    --dark-primary: #000000;
    --dark-text: #ffffff;
    --dark-header: #000000;
    --dark-card-bg: #171923;
    --dark-subtext: #d1d5db;
    --dark-heading: #e5e7eb;
}

[data-theme="dark"] {
    --text-color: #ffffff;
    --background-color: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background: transparent;
    line-height: 1.6;
    transition: color 0.3s, background 0.3s;
    overflow-x: hidden;
    position: relative;
}

header, section {
    position: relative;
    z-index: 1;
    background: transparent;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: visible;
    will-change: background, transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

[data-theme="light"] .background-animation {
    background: linear-gradient(to bottom, #ffffff, #aaaaaa);
}

[data-theme="dark"] .background-animation {
    background: linear-gradient(to bottom, #1a1a1a, #000000);
}

.flare {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity, box-shadow;
    transform: translateZ(0);
    visibility: visible !important;
    z-index: -1;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 0.5s ease-in-out;
}

.flare.large {
    width: 150px;
    height: 150px;
}

.flare.small {
    width: 80px;
    height: 80px;
}

[data-theme="dark"] .flare {
    background: radial-gradient(circle, rgba(135, 206, 250, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    box-shadow: none;
}

[data-theme="light"] .flare {
    background: radial-gradient(circle, rgba(0, 128, 128, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
}

[data-theme="dark"] {
    background: linear-gradient(to bottom, #1a1a1a, #000000);
}

[data-theme="light"] {
    --primary-color: var(--light-background, #ffffff);
    --text-color: #000000;
}

header {
    background-color: rgba(0, 0, 0, 0.9);
    color: var(--color-header);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: none;
    padding: 0 40px;    
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-header);
    transition: font-size 0.3s ease, color 0.3s ease;
    display: inline-block; /* Ensure text behaves as a block for transform */
}

.logo-image {
    width: 50px; /* Initial size of the image */
    height: auto; /* Maintain aspect ratio */
    transition: width 0.3s ease, height 0.3s ease; /* Match text transition */
}

.logo-container:hover .logo {
    font-size: 3rem;
    color: var(--highlight-lightteal);
}

.logo-container:hover .logo-image {
    width: 100px; /* Double the initial size to match text expansion */
    height: auto; /* Maintain aspect ratio */
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    color: var(--color-header);
}

.nav-links li a {
    color: inherit;
    font-size: 1.1rem;
    display: inline-block;
    transform-origin: center;
    will-change: transform, color;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links li a:hover {
    color: var(--highlight-lightred);
    transform: scale(1.50);
}

/* Explicit fallback for Home link to ensure consistency */
.nav-links li a[href="#home"]:hover {
    color: var(--highlight-lightred);
    transform: scale(1.50);
}

/* Optional: Ensure active or current page styling doesn’t interfere */
.nav-links li a.active,
.nav-links li a:focus {
    outline: none;
    transform: scale(1.05); /* Subtle focus effect */
    color: var(--highlight-lightred); /* Match hover color */
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--color-header);
    transition: all 0.3s;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--color-header);
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 768px) {
    nav {
        padding: 0 20px;
    }
    .nav-right {
        flex-direction: row-reverse;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        padding: 20px;
        text-align: center;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li a {
        display: inline-block;
    }
    .hamburger {
        display: flex;
    }
}

[data-theme="dark"] .nav-links {
    color: var(--dark-heading);
}

[data-theme="dark"] .bar {
    background: var(--dark-heading);
}

/* HERO SECTION */
.hero-section {
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    animation: pulse 4s infinite, glitchEffect 0.5s ease infinite;
    position: relative;
}

[data-theme="dark"] .hero-title {
    color: var(--dark-heading);
}

@keyframes glitchEffect {
    0% { transform: translate(0, 0); text-shadow: 0 0 0 transparent; }
    20% { transform: translate(-4px, 2px); text-shadow: 4px 0 5px var(--highlight-lightred), -4px 0 5px var(--highlight-teal); }
    40% { transform: translate(4px, -2px); text-shadow: -4px 0 5px var(--highlight-lightred), 4px 0 5px var(--highlight-teal); }
    60% { transform: translate(-2px, 3px); text-shadow: 2px 0 5px var(--highlight-lightred), -2px 0 5px var(--highlight-teal); }
    80% { transform: translate(2px, -3px); text-shadow: -2px 0 5px var(--highlight-lightred), 2px 0 5px var(--highlight-teal); }
    100% { transform: translate(0, 0); text-shadow: 0 0 0 transparent; }
}

.hero-subtitle {
    font-size: 2rem;
    color: #4a5568;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    flex-wrap: wrap;
}

.subtitle-role {
    display: inline-block;
    transition: transform 0.5s ease, color 0.5s ease;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-tagline {
    font-size: 3rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    text-transform: none;
    color: #d1d5db;
    margin-bottom: 70px;
    position: relative;
    z-index: 2;
    display: inline-block;
    white-space: normal;
    line-height: 1.4;
    letter-spacing: 0.02em;
    max-width: 1700px;
}

:root {
    --blue-accent: #030c14;
    --highlight-teal: #20867c;
}

[data-theme="light"] {
    --blue-accent: #0b2b4b;
}

[data-theme="light"] .hero-tagline {
    color: #1a2526;
}

.hero-tagline .letter {
    display: inline-block;
    margin: 0 1px;
    opacity: 0;
    color: inherit;
}

@keyframes mgsLetterFlicker {
    25% { opacity: 0.25; color: #1c76d1; }
    50% { opacity: 0.5; color: #1a6fc4; }
    100% { opacity: 1; color: var(--highlight-teal); }
}

.hero-tagline.animated .letter {
    animation: mgsLetterFlicker 0.8s ease infinite;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-button {
    background-color: var(--highlight-indigo);
    color: #fff;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
}

.hero-button:hover {
    background-color: var(--highlight-dark-indigo);
    transform: scale(1.05);
}

.hero-button:active {
    transform: scale(0.95);
}

.hero-section.bounced,
.skills-section.bounced,
.timeline-section.bounced,
.projects-section.bounced,
.contact-section.bounced,
#about.bounced {
    animation: bounce 0.6s ease-out;
    animation-fill-mode: forwards;
}

.hero-section {
    animation: fadeIn 1s ease-in;
    animation-fill-mode: forwards;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.3rem;
        gap: 20px;
    }
    .hero-tagline {
        font-size: 1.5rem;
    }
}

/* SECTION HEADER */
.section-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
}

.section-line {
    width: 200px;
    height: 3px;
    background-color: var(--highlight-lightred);
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.section-header.visible .section-line {
    opacity: 1;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-align: center;
    opacity: 0;
    color: #2d3748;
    transition: opacity 0.8s ease-out, color 0.3s ease, transform 0.3s ease;
}

[data-theme="dark"] .section-title {
    color: var(--dark-heading);
}

.section-header.visible .section-title {
    opacity: 1;
}

.section-title:hover {
    color: var(--highlight-darkteal);
    animation: scaleUp 0.3s ease forwards;
}

[data-theme="dark"] .section-title:hover {
    color: var(--highlight-teal);
    animation: scaleUp 0.3s ease forwards;
}

@keyframes scaleUp {
    to {
        transform: scale(1.2);
    }
}

/* ABOUT SECTION */
.about-content {
    width: 80%;
    max-width: 1500px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.about-window {
    background: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow: hidden;
    min-height: 200px;
    border: 2px solid var(--highlight-indigo);
}

[data-theme="dark"] .about-window {
    background: var(--dark-card-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.section-header.visible + .about-content {
    opacity: 1;
}

.about-description {
    font-size: 1.5rem;
    color: #4a5568;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
    display: none;
    margin: 0;
}

.about-window .about-description:first-of-type {
    margin-bottom: 1.5rem;
}

.about-description .typewriter-word:first-child {
    text-indent: 2rem;
    display: inline-block;
}

.about-description.visible {
    display: block;
}

[data-theme="dark"] .about-description {
    color: var(--dark-subtext);
}

.typewriter-word {
    text-indent: 0;
    display: inline-block;
    opacity: 0;
}

.about-description.visible .typewriter-word {
    animation: typeFade 0.5s forwards;
}

.typewriter-word:nth-child(1) { animation-delay: 0s; }
.typewriter-word:nth-child(2) { animation-delay: 0.08s; }
.typewriter-word:nth-child(3) { animation-delay: 0.16s; }
.typewriter-word:nth-child(n+4) {
    animation-delay: calc(0.08s * (var(--word-index) - 3));
}

@media (max-width: 768px) {
    .about-content {
        width: 90%;
        max-width: 600px;
    }
    .about-window {
        padding: 15px;
        min-height: 250px;
    }
    .about-description .typewriter-word:first-child {
        text-indent: 1.5rem;
        display: inline-block;
    }
    .about-window .about-description:first-of-type {
        margin-bottom: 1rem;
    }
}

/* SKILLS SECTION */
.skills-section {
    padding: 180px; /* Reduced top padding to 20px, kept bottom padding for spacing */
    text-align: center;
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 1;
}

.skills-content {
    max-width: 800px;
    margin: 0 auto;
}

.skill-category {
    font-size: 1.8rem;
    color: #2d3748;
    margin: 30px 0 30px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.skill-category.visible {
    opacity: 1;
    transform: translateX(0);
}

.skill-category.visible:hover {
    transform: scale(1.5);
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    min-height: 20px;
}

.skill-item {
    background-color: var(--highlight-indigo);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    display: flex;
    align-items: center;
}

.skills-section.visible .skill-item {
    opacity: 1;
    transform: translateX(0);
    animation: skillFade 4s infinite;
}

.skill-item.visible {
    opacity: 1;
    transform: translateX(0);
    animation: skillFade 4s infinite;
}

.skill-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
}

.skill-icon:hover {
    transform: scale(1.5);
}

/* TIMELINE SECTION */
.timeline-section {
    padding: 100px 20px;
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 1;
}

.timeline {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 4px;
    background-color: var(--highlight-lightred);
    height: 0;
    transform: translateX(-50%);
    transition: height 1.5s ease-in-out;
}

.timeline-event {
    position: relative;
    margin: 40px 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.timeline-event.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--highlight-lightred);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.68, -0.55, 0.265, 1.55), transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.timeline-event.visible .timeline-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.timeline-date {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    font-size: 1.6rem;
    color: var(--highlight-date);
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, color 0.3s;
    z-index: 2;
}

.timeline-event.visible .timeline-date {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.timeline-content.left + .timeline-date {
    left: calc(50% + 25px);
    text-align: left;
}

.timeline-content.right + .timeline-date {
    right: calc(50% + 25px);
    text-align: right;
}

.timeline-content {
    width: 45%;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 2px solid var(--highlight-indigo);
    opacity: 0;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.timeline-content.left {
    transform: translateX(-30px);
    margin-right: 52%;
}

.timeline-content.right {
    transform: translateX(20px);
    margin-left: 54%;
}

.timeline-event.visible .timeline-content {
    opacity: 1;
    transform: translateX(0);
}

.timeline-content h3 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.timeline-subtitle {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 10px;
}

.timeline-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.7;
}

/* PROJECTS SECTION */
.projects-section {
    padding: 20px 20px 100px; /* Reduced top padding to 20px, kept bottom padding for spacing */
    text-align: center;
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 1;
}

.projects-container {
    position: relative;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 20px;
    padding: 20px 0;
    width: 100%;
}

.project-card {
    min-width: calc(33.333% - 14px);
    max-width: calc(33.333% - 14px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    background: var(--dark-card-bg);
    border: 2px solid var(--highlight-indigo);
    flex: 0 0 calc(33.333% - 14px);
    height: 600px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 0; /* Keep original padding at bottom */
}

.project-card:hover {
    transform: translateY(-20px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.project-image {
    width: 90%;
    height: 310px;
    margin: 0 auto; /* Center the image */
    display: block;
    object-fit: cover;
    border-radius: 8px;
}

.project-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card h3 {
    margin: 0 0 10px;
    font-size: 1.75rem;
    color: var(--highlight-darkteal);
}

.project-card p {
    margin: 0 0 20px;
    font-size: 1rem;
    color: var(--text-color);
    flex-grow: 1;
}

.project-button {
    background-color: var(--highlight-indigo);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s;
    align-self: center;
    text-decoration: none;
    margin-top: auto;
}

.project-button:hover {
    background-color: var(--highlight-dark-indigo);
    transform: scale(1.05);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--highlight-indigo);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.carousel-arrow:hover {
    background: var(--highlight-dark-indigo);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.left-arrow {
    left: 10px;
}

.right-arrow {
    right: 10px;
}

/* Light Mode Specific Styles */
[data-theme="light"] .project-card {
    background: #ffffff;
    border: 2px solid var(--highlight-dark-indigo);
}

[data-theme="light"] .project-card h3 {
    color: var(--highlight-darkteal);
}

[data-theme="light"] .project-card p {
    color: #4a5568;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .project-card {
        min-width: calc(50% - 10px);
        max-width: calc(50% - 10px);
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .project-card {
        min-width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    .projects-container {
        padding: 0 20px;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Dropdown Menu for Projects */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding: 5px 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 4px;
}

.dropdown-menu a {
    display: block;
    padding: 5px 15px;
    color: #4a5568;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.3s ease, transform 0.3s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a.selected {
    color: var(--highlight-lightred);
    transform: scale(1.05);
}

[data-theme="dark"] .dropdown-menu {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .dropdown-menu a {
    color: #d1d5db;
}

[data-theme="dark"] .dropdown-menu a:hover,
[data-theme="dark"] .dropdown-menu a.selected {
    color: var(--highlight-lightred);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        padding: 5px 0;
        text-align: center;
    }
    .nav-links.active .dropdown .dropdown-menu {
        display: block;
    }
}

/* Project Page Styles */
.project-page {
    padding: 100px 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.project-details {
    max-width: 800px;
    width: 100%;
    background: var(--background-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--highlight-indigo);
}

[data-theme="dark"] .project-details {
    background: var(--dark-card-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.project-details h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
}

[data-theme="dark"] .project-details h1 {
    color: var(--dark-heading);
}

.project-details p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.8;
}

[data-theme="dark"] .project-details p {
    color: var(--dark-subtext);
}

.project-details .project-button {
    display: block;
    width: fit-content;
    margin: 0 auto;
    background-color: var(--highlight-indigo);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.project-details .project-button:hover {
    background-color: var(--highlight-dark-indigo);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .project-details {
        padding: 20px;
    }
    .project-details h1 {
        font-size: 2rem;
    }
    .project-details p {
        font-size: 1rem;
    }
}

/* CONTACT SECTION */
.contact-section {
    padding: 10px 10px 100px; /* Reduced top padding to 1px, kept bottom padding for spacing */
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 1;
}

.contact-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
}

.contact-info {
    font-size: 1.2rem;
    margin-bottom: 30px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-info a,
.contact-info span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-info a:hover,
.contact-info span:hover {
    color: var(--highlight-lightred);
    transform: scale(1.1);
}

.contact-info i {
    color: inherit;
}

[data-theme="dark"] .contact-info a,
[data-theme="dark"] .contact-info span {
    color: var(--tagline-dark);
}

[data-theme="dark"] .contact-info a:hover,
[data-theme="dark"] .contact-info span:hover {
    color: var(--highlight-lightred);
}

.contact-form {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
}

.contact-form textarea {
    resize: vertical;
    height: 150px;
}

.contact-form button {
    background-color: var(--highlight-indigo);
    color: #fff;
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    align-self: center;
}

.contact-form button:hover {
    background-color: var(--highlight-dark-indigo);
    transform: scale(1.05);
}

/* FOOTER SECTION */
.site-footer {
    background-color: var(--background-color-header);
    color: var(--color-header);
    padding: 30px;
    text-align: center;
    border-top: 1px solid #4a5568;
    position: relative;
    z-index: 1;
}

.back-to-top {
    color: var(--color-header);
    font-size: 1rem;
    margin-top: 10px;
    display: none; /* Initially hidden */
    transition: color 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    color: var(--highlight-lightred);
    transform: scale(1.1);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* DARK MODE */
[data-theme="dark"] {
    --primary-color: #000000;
    --text-color: #ffffff;
}

[data-theme="dark"] .hero-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .timeline-content h3,
[data-theme="dark"] .skill-category {
    color: var(--dark-heading);
}

[data-theme="dark"] .hero-subtitle,
[data-theme="dark"] .hero-tagline,
[data-theme="dark"] .about-description,
[data-theme="dark"] .timeline-subtitle,
[data-theme="dark"] .timeline-description,
[data-theme="dark"] .contact-description {
    color: var(--dark-subtext);
}

[data-theme="dark"] .hero-tagline {
    color: var(--tagline-dark);
}

[data-theme="dark"] .timeline-content {
    background-color: var(--dark-card-bg);
    border: 2px solid var(--highlight-indigo);
}

[data-theme="dark"] .timeline-date {
    color: var(--highlight-date-dark);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes typeFade {
    to { opacity: 1; }
}

@keyframes skillFade {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    40% { transform: translateY(-25px); }
    60% { transform: translateY(15px); }
    80% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

body {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

body.fade-out {
    opacity: 0;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-load {
    animation: pageFadeIn 0.8s ease-in-out forwards;
}