/* --- Global Variables & Default Dark Theme --- */
:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2c2c2c;
    --text-color: #e0e0e0;
    --accent-color: #00aaff;
    --border-color: #444;
}

/* --- Light Theme Variables --- */
body.light-mode {
    --primary-bg: #f4f4f4;
    --secondary-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dddddd;
}

/* --- Easter Egg Theme Variables --- */
body.easter-egg-mode {
    --primary-bg: #8B0000;
    --secondary-bg: #7a0000;
    --text-color: #f0e68c;
    --accent-color: #5C4033;
    --border-color: #4a3328;
}

/* --- General Body & Typography --- */
body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

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

/* --- Navigation Bar --- */
.navbar {
    background-color: var(--secondary-bg);
    padding: 1rem 20px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar nav {
    width: 100%;
    max-width: 960px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar .nav-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Base properties for ALL nav links */
.navbar .nav-links a {
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: transform 0.2s ease-out, background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* --- DARK MODE STYLES (DEFAULT) --- */
.navbar .nav-links a {
    background-color: #333;
    border-color: #555;
    color: #ffffff;
}
.navbar .nav-links a.active {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

/* --- LIGHT MODE STYLES --- */
body.light-mode .navbar .nav-links a {
    background-color: #ffffff;
    border-color: #cccccc;
    color: #000000;
}
body.light-mode .navbar .nav-links a.active {
    background-color: #333;
    border-color: #333;
    color: #ffffff;
}

/* --- HOVER STYLE --- */
.navbar .nav-links a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(4px);
}
body.light-mode .navbar .nav-links a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

/* --- Easter Egg Button Overrides --- */
body.easter-egg-mode .navbar .nav-links a {
    background-color: #5C4033;
    border-color: #4a3328;
    color: #f0e68c;
}
body.easter-egg-mode .navbar .nav-links a.active {
    background-color: #f0e68c;
    border-color: #f0e68c;
    color: #5C4033;
}
body.easter-egg-mode .navbar .nav-links a:hover {
    background-color: #f0e68c;
    border-color: #f0e68c;
    color: #5C4033;
}

/* --- Theme Toggle Button --- */
#theme-toggle-btn {
    background-color: var(--text-color);
    color: var(--primary-bg);
    border: none;
    padding: 14px 20px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

/* --- Main Content Area --- */
.main-content {
    background-color: var(--secondary-bg);
    padding: 30px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* --- Achievements Table (index.html) --- */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}
.achievements-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}
.achievements-table th, .achievements-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}
.achievements-table th {
    background-color: var(--accent-color);
    color: #ffffff;
    font-weight: bold;
}
body.easter-egg-mode .achievements-table th {
    color: #f0e68c;
}

/* --- Social Icons (social.html) --- */
.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}
.social-links a {
    font-size: 4em;
    color: var(--text-color);
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* --- Timeline (timeline.html) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--accent-color);
    transform: translateX(-50%);
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}
.timeline-item:nth-child(odd) {
    left: 0;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -11px;
    background-color: var(--primary-bg);
    border: 4px solid var(--accent-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(even)::after {
    left: -9px;
}
.timeline-content {
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 6px;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9em;
    color: #888;
    border-top: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    transition: border-color 0.3s, background-color 0.3s;
}
body.easter-egg-mode .site-footer {
    color: #d3c781;
}

/* --- Back to Top Button --- */
#back-to-top-btn {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translate(-50%, -20px);
    z-index: 999;
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;
}
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
#back-to-top-btn:hover {
    background-color: #0088cc;
}
body.easter-egg-mode #back-to-top-btn {
    color: #f0e68c;
}
body.easter-egg-mode #back-to-top-btn:hover {
    background-color: #4a3328;
}

/* --- Scroll Animation --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .navbar {
        justify-content: space-between;
    }
    .hamburger {
        display: block;
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    .nav-links {
        position: fixed;
        left: -100%;
        top: 85px;
        gap: 0;
        flex-direction: column;
        background-color: var(--secondary-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
    }
    .nav-links.active {
        left: 0;
    }
    .nav-links li {
        width: 100%;
        padding: 10px 0;
    }
    .nav-links a {
        width: 80%;
        margin: 5px auto;
    }
    .timeline::before {
        left: 20px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }
    .timeline-item::after {
        left: 10px;
    }
    .social-links a {
        font-size: 3em;
    }
    #github-profile-card {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Profile Card --- */
#github-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--primary-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

#github-profile-card .profile-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
}

#github-profile-card .profile-details h3 {
    margin: 0 0 10px 0;
    border: none;
    padding: 0;
}

#github-profile-card .profile-stats {
    display: flex;
    flex-wrap: wrap; /* Allows stats to wrap on smaller screens */
    gap: 15px;
    margin-top: 15px;
    font-size: 0.9em;
    color: #aaa;
}
body.light-mode #github-profile-card .profile-stats {
    color: #555;
}
body.easter-egg-mode #github-profile-card .profile-stats {
    color: #d3c781;
}

/* --- Repo Cards --- */
#github-repos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.repo-card {
    background-color: var(--primary-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-color);
    display: flex;
    flex-direction: column;
}

.repo-card h4 {
    margin: 0 0 10px 0;
    border: none;
    padding: 0;
}

.repo-card p {
    flex-grow: 1;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.repo-card .repo-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #aaa;
}
body.light-mode .repo-card .repo-stats {
    color: #555;
}
body.easter-egg-mode .repo-card .repo-stats {
    color: #d3c781;
}