/* ===== CSS VARIABLES ===== */
:root {
    /* Dark mode (default) variables */
    --bg-color: #0a0a0a;
    --text-color: #f5f5f5;
    --accent-color: #3182ce;
    --secondary-color: #2c2c2c;
    --hover-color: #2c5282;
    --error-color: #e53e3e;
    --spacing: 2rem;
    --menu-transition-timing: cubic-bezier(0.645, 0.045, 0.355, 1);
    --menu-transition-duration: 0.3s;

    /* Light mode variables */
    --light-bg-color: #f5f5f5;
    --light-text-color: #0a0a0a;
    --light-accent-color: #2563eb;
    --light-secondary-color: #d0d0d0;
    --light-border-color: #c0c0c0;
    --light-node-color: #0066ff;
    --light-connection-color: #003366;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
    position: relative;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.light-mode {
    background-color: var(--light-bg-color);
    color: var(--light-text-color);
}

body.menu-open {
    overflow: hidden; /* Prevents scrolling when mobile menu is open */
}

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

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

.light-mode a {
    color: var(--light-text-color);
}

.light-mode a:hover {
    color: var(--light-accent-color);
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 800;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    max-width: 600px;
}

.light-mode .subtitle {
    color: rgba(10, 10, 10, 0.7);
}

/* ===== LAYOUT COMPONENTS ===== */
/* Main structural elements of the page */
section {
    padding: var(--spacing) 0;
    border-bottom: 1px solid var(--secondary-color);
    position: relative;
    z-index: 1;
}

.light-mode section {
    border-bottom: 1px solid var(--light-secondary-color);
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    padding: var(--spacing) 0;
    position: relative;
    z-index: 1;
}

footer {
    padding: var(--spacing) 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

.light-mode footer {
    color: var(--light-text-color);
}

/* ===== NAVIGATION ===== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing) 0;
    border-bottom: 1px solid var(--secondary-color);
    position: relative;
    z-index: 10; /* Higher z-index to stay above other elements */
    background-color: transparent;
}

.light-mode nav {
    border-bottom: 1px solid var(--light-border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.light-mode .logo {
    color: var(--light-text-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    background-color: transparent;
}

.light-mode .nav-links {
    background-color: transparent;
}

/* ===== BACKGROUND EFFECTS ===== */
/* Particle network background animation */
.particle-network-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    opacity: 0.3;
    background-color: var(--bg-color);
    z-index: -1; /* Behind all content */
}

.light-mode .particle-network-animation {
    background-color: var(--light-bg-color);
    opacity: 0.7;
}

/* ===== THEME TOGGLE ===== */
/* Controls for switching between light and dark mode */
.theme-toggle-container {
    margin-left: 0.1rem;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.themeToggle {
    color: var(--text-color);
    width: 1.8em;
    height: 1.8em;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-mode .themeToggle {
    color: var(--light-text-color);
}
  
.st-sunMoonThemeToggleBtn {
    position: relative;
    cursor: pointer;
}
  
.st-sunMoonThemeToggleBtn .themeToggleInput {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}
  
.st-sunMoonThemeToggleBtn svg {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
    transform: rotate(40deg);
}
  
.st-sunMoonThemeToggleBtn svg .sunMoon {
    transform-origin: center center;
    transition: inherit;
    transform: scale(1);
}
  
.st-sunMoonThemeToggleBtn svg .sunRay {
    transform-origin: center center;
    transform: scale(0);
}
  
.st-sunMoonThemeToggleBtn svg mask > circle {
    transition: transform 0.64s cubic-bezier(0.41, 0.64, 0.32, 1.575);
    transform: translate(0px, 0px);
}
  
/* Animation delays for sun rays */
.st-sunMoonThemeToggleBtn svg .sunRay2 {
    animation-delay: 0.05s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay3 {
    animation-delay: 0.1s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay4 {
    animation-delay: 0.17s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay5 {
    animation-delay: 0.25s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay6 {
    animation-delay: 0.29s !important;
}
  
/* Theme toggle checked state */
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg {
    transform: rotate(90deg);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg mask > circle {
    transform: translate(16px, -3px);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg .sunMoon {
    transform: scale(0.55);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg .sunRay {
    animation: showRay1832 0.4s ease 0s 1 forwards;
}
  
@keyframes showRay1832 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== BUTTONS ===== */
/* Button styles used throughout the site */
.button {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.light-mode .button {
    background-color: var(--light-accent-color);
}

.button:hover {
    background-color: var(--hover-color);
}

.light-mode .button:hover {
    background-color: var(--hover-color);
}

/* Secondary button variant */
.button.secondary {
    background-color: transparent;
    border: 1px solid var(--text-color);
}

.light-mode .button.secondary {
    background-color: transparent;
    border: 1px solid var(--light-text-color);
    color: var(--light-text-color);
}

.button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.light-mode .button.secondary:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ===== TIMELINE COMPONENT ===== */
/* Timeline for displaying chronological information (e.g., work experience) */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Vertical timeline line */
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}

/* Timeline items */
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
    will-change: transform, opacity;
}

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

.timeline-item-left {
    left: 0;
}

.timeline-item-right {
    left: 50%;
}

/* Timeline dots (circular markers) */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--bg-color);
    border: 3px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.light-mode .timeline-item::after {
    background-color: var(--light-bg-color);
    border: 3px solid var(--light-accent-color);
}

.timeline-item-left::after {
    right: -13px;
}

.timeline-item-right::after {
    left: -13px;
}

/* Timeline content boxes */
.timeline-content {
    padding: 20px 25px;
    background-color: var(--secondary-color);
    position: relative;
    border-radius: 6px;
}

.light-mode .timeline-content {
    background-color: var(--light-secondary-color);
    color: var(--light-text-color);
}

/* Arrow pointers for timeline boxes */
.timeline-content::after {
    content: '';
    position: absolute;
    border-width: 10px;
    border-style: solid;
    top: 15px;
}

.timeline-item-left .timeline-content::after {
    border-color: transparent var(--secondary-color) transparent transparent;
    right: 100%;
}

.light-mode .timeline-item-left .timeline-content::after {
    border-color: transparent var(--light-secondary-color) transparent transparent;
}

.timeline-item-right .timeline-content::after {
    border-color: transparent transparent transparent var(--secondary-color);
    left: 100%;
}

.light-mode .timeline-item-right .timeline-content::after {
    border-color: transparent transparent transparent var(--light-secondary-color);
}

/* Timeline text elements */
.timeline-date {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.light-mode .timeline-subtitle {
    color: rgba(10, 10, 10, 0.7);
}

.timeline-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== SKILLS SECTION ===== */
/* Grid layout for displaying skill categories */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    margin-bottom: 2rem;
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.skill-tag {
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.light-mode .skill-tag {
    background-color: var(--light-secondary-color);
}

/* ===== CERTIFICATIONS ===== */
/* Styling for certification listings */
.certification {
    margin-bottom: 2rem;
}

.certification-org {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ===== CONTACT FORM ===== */
/* Contact form container and layout */
.contact-form-container {
    max-width: 600px;
    margin: 2rem 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 1.5rem;
}

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

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

body.light-mode .form-group label {
    color: var(--light-text-color);
}

/* Form inputs styling */
.contact-form input,
.contact-form textarea {
    background-color: rgba(44, 44, 44, 0.8);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
}

body.light-mode .contact-form input,
body.light-mode .contact-form textarea {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--light-secondary-color);
    color: var(--light-text-color);
    border-radius: 4px;
}

.form-group input,
.form-group textarea {
    background-color: var(--secondary-color);
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 0.8rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.light-mode .contact-form ::placeholder {
    color: rgba(10, 10, 10, 0.6);
}

/* Form validation */
.form-group input.error,
.form-group textarea.error {
    border-color: var(--error-color);
    background-color: rgba(229, 62, 62, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.contact-form .button {
    align-self: flex-start;
    margin-top: 1rem;
}

/* ===== SOCIAL LINKS ===== */
/* Social media links styling */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
/* Reusable animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

/* ===== RESPONSIVE STYLES ===== */
/* Mobile and tablet adjustments */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 {
        font-size: 3rem;
    }

    body.light-mode {
        background-color: var(--light-bg-color);
        color: var(--light-text-color);
    }

    /* Background adjustments */
    .particle-network-animation {
        height: 100%;
    }

    /* Mobile Timeline adjustments */
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item-right {
        left: 0;
    }

    .timeline-item::after {
        left: 21px;
    }

    .timeline-item-left .timeline-content::after {
        border-color: transparent transparent transparent var(--secondary-color);
        left: 100%;
        right: auto;
    }

    .light-mode .timeline-item-left .timeline-content::after {
        border-color: transparent transparent transparent var(--light-secondary-color);
        left: 100%;
        right: auto;
    }

    .timeline-item-right .timeline-content::after {
        border-color: transparent transparent transparent var(--secondary-color);
        left: 100%;
    }

    .light-mode .timeline-item-right .timeline-content::after {
        border-color: transparent transparent transparent var(--light-secondary-color);
        left: 100%;
    }

    /* Mobile Skills Grid */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Form */
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Mobile Social Links */
    .social-links {
        flex-direction: column;
        gap: 1rem;
    }
}