/* Global Variables */
:root {
    /* Base Colors */
    --yellow: #f4a300;
    --red: #f44336;
    --blue: #00bcd4;

    /* Semantic Variables (Light Mode Default) */
    --bg-body: #f2f2f2;
    --bg-nav: #f2f2f2;
    --text-main: #111;
    --text-secondary: #333;
    --text-muted: #777;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #ccc;
    --nav-border: #eee;
    --card-bg: #fff;
    --light-gray: #ccc;
    /* Kept for legacy if needed, but prefer semantic */
    --dark-gray: #777;
}

[data-theme="dark"] {
    /* Dark Mode Overrides */
    --bg-body: #121212;
    --bg-nav: #1e1e1e;
    --text-main: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --border-color: #333;
    --nav-border: #333;
    --card-bg: #1e1e1e;
    --light-gray: #333;
    --dark-gray: #aaa;
}

/* Basic Reset */
* {
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Body & HTML Structure */
body,
html {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding: 40px;
    /* Overall padding for the page */
    line-height: 1.6;
}

/* Header Styles - Consistent across all pages */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    padding: 0 20px;
    /* Add some padding for header content */
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    z-index: 1001;
    color: var(--text-main);
}

.logo-dot {
    background-color: var(--yellow);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.logo span.role {
    font-weight: normal;
    font-size: 14px;
    margin-left: 8px;
    color: var(--text-muted);
}

/* Navigation Styles */
nav a {
    text-decoration: none;
    color: var(--text-main);
    margin-left: 25px;
    font-size: 16px;
    position: relative;
    padding-bottom: 5px;
}

nav a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--text-main);
    left: 0;
    bottom: 0;
    transition: 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    color: var(--text-main);
}

/* Main Content Container */
.container {
    flex: 1;
    /* Allows main content to grow */
    max-width: 900px;
    /* Max width for content sections */
    margin: 0 auto;
    /* Center the content */
    padding: 20px;
    /* Padding inside the container */
    background-color: var(--card-bg);
    /* White background for resume content */
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow-color);
    margin-bottom: 60px;
    /* Space before the CV download section */
}

/* Section Styling (Education, Skills, Work) */
.section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
    /* No border for the last section */
    margin-bottom: 0;
}

.section h2 {
    font-size: 2rem;
    color: var(--yellow);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Space between icon and text */
}

.section h2 i {
    font-size: 1.8rem;
    color: var(--text-main);
    /* Icon color */
}

/* Entry Styling (Education, Work) */
.entry {
    display: flex;
    margin-bottom: 25px;
    border-left: 3px solid var(--yellow);
    /* Timeline-like effect */
    padding-left: 20px;
    position: relative;
}

.entry::before {
    content: '';
    position: absolute;
    left: -8px;
    /* Position the dot on the line */
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--text-main);
    border-radius: 50%;
    border: 2px solid var(--yellow);
    /* Yellow ring around the dot */
}


.entry .year {
    font-weight: bold;
    color: var(--text-muted);
    min-width: 120px;
    /* Fixed width for year column */
    font-size: 0.95rem;
    flex-shrink: 0;
    /* Prevent shrinking */
    margin-top: 5px;
    /* Align with entry content */
}

.entry .content {
    flex-grow: 1;
}

.entry .content h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.entry .content p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Skills List */
.skills-list {
    list-style: none;
    /* Remove default bullet points */
    display: grid;
    /* Use grid for skills */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Responsive grid */
    gap: 15px;
    /* Space between skill items */
}

.skills-list li {
    background-color: var(--bg-body);
    /* Light background for each skill */
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skills-list li::before {
    content: '•';
    /* Custom bullet point */
    color: var(--yellow);
    font-weight: bold;
    font-size: 1.2em;
}

/* Download CV Section */
#cv {
    text-align: center;
    padding: 40px;
    /* Separate padding for this section */
    margin-top: 40px;
    /* Space from container */
    margin-bottom: 80px;
    /* Space before footer */
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow-color);
    /* Lighter shadow */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#cv h2 {
    color: var(--text-main);
    /* Use black for this title */
    margin-bottom: 30px;
    font-size: 2.2rem;
}

.download-btn {
    display: inline-flex;
    /* Align icon and text */
    align-items: center;
    gap: 10px;
    background: var(--yellow);
    color: white;
    /* Always white text on yellow button */
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.download-btn i {
    font-size: 1.2rem;
}

.download-btn:hover {
    background: #e09200;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

/* Footer Styles - Consistent across all pages */
footer {
    margin-top: auto;
    /* Push footer to the bottom */
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    background-color: var(--bg-body);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    max-width: 1000px;
    margin: auto;
    text-align: left;
}

.footer-section {
    min-width: 150px;
    flex: 1 1 200px;
    opacity: 0;
    /* For fade-in animation, controlled by JS */
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.footer-section.visible {
    /* Class added by JS */
    opacity: 1;
    transform: translateY(0);
}

.footer-section strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.footer-section p {
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.social-icons {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    /* Align to start in desktop */
}

.social-icons a {
    color: var(--text-main);
    font-size: 22px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--yellow);
}

.footer-bottom {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--text-main);
    text-decoration: underline;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--card-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.loader {
    font-size: 48px;
    animation: bounce 1.2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Back to Top Button Styles */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 0.7rem 1.1rem;
    background: var(--yellow);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: background 0.3s ease, transform 0.2s ease;
    line-height: 1;
    /* For better vertical alignment of arrow */
}

#backToTop:hover {
    background: #e09200;
    transform: translateY(-3px);
}

/* Theme Toggle Button Styles */
.theme-toggle {
    cursor: pointer;
    font-size: 20px;
    margin-left: 20px;
    color: var(--text-main);
    background: none;
    border: none;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--yellow);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    header {
        margin-bottom: 40px;
        flex-wrap: wrap;
        padding: 0 15px;
    }

    .logo {
        flex-grow: 1;
    }

    .menu-toggle {
        display: block;
        order: 2;
        margin-left: auto;
    }

    nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-nav);
        box-shadow: 0 8px 16px var(--shadow-color);
        padding: 20px 0;
        border-top: 1px solid var(--nav-border);
        z-index: 1000;
    }

    nav.active {
        display: flex;
    }

    nav a {
        margin: 15px 0;
        text-align: center;
        color: var(--text-main);
    }

    .container {
        padding: 15px;
        margin-bottom: 40px;
    }

    .section h2 {
        font-size: 1.8rem;
        flex-direction: column;
        /* Stack icon and text on small screens */
        text-align: center;
        margin-bottom: 20px;
    }

    .section h2 i {
        margin-bottom: 10px;
        /* Space between icon and text */
    }

    .entry {
        flex-direction: column;
        /* Stack year and content vertically */
        padding-left: 0;
        /* Remove left padding */
        border-left: none;
        /* Remove timeline border */
    }

    .entry::before {
        display: none;
        /* Hide the dot */
    }

    .entry .year {
        min-width: unset;
        text-align: left;
        /* Align year to left */
        margin-bottom: 5px;
    }

    .skills-list {
        grid-template-columns: 1fr;
        /* Single column for skills */
    }

    #cv {
        padding: 30px;
        margin-top: 30px;
        margin-bottom: 60px;
    }

    #cv h2 {
        font-size: 2rem;
    }

    .download-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    footer .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        text-align: center;
        width: 100%;
    }

    .social-icons {
        justify-content: center;
        /* Center social icons on mobile */
        margin-bottom: 15px;
    }

    #backToTop {
        bottom: 20px;
        right: 20px;
        padding: 0.6rem 1rem;
        font-size: 1.3rem;
    }
}

/* Further small screen adjustments */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    header {
        margin-bottom: 30px;
    }

    .logo {
        font-size: 18px;
    }

    .logo span.role {
        font-size: 12px;
    }

    .container {
        padding: 10px;
    }

    .section h2 {
        font-size: 1.6rem;
    }

    .entry .content h3 {
        font-size: 1.2rem;
    }

    .entry .content p,
    .skills-list li {
        font-size: 0.95rem;
    }

    #cv {
        padding: 20px;
    }

    #cv h2 {
        font-size: 1.8rem;
    }

    .download-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    footer {
        padding: 20px 10px;
    }

    .footer-bottom {
        margin-top: 20px;
    }
}