* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2C3E50;
    --accent-color: #3498DB;
    --background-color: #ECF0F1;
    --card-bg-color: #FFFFFF;
    --text-color: #333;
    --text-light: #fff;
    --nav-height: 60px;
}

body.dark-mode {
    --primary-color: #1a252f;
    --accent-color: #5DADE2;
    /* Lighter blue for better contrast on dark */
    --background-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-light: #f5f5f5;
}

/* Dark mode specific adjustments */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode strong {
    color: var(--text-light);
}

body.dark-mode .skill-category strong {
    color: var(--accent-color);
}

body.dark-mode .timeline-content,
body.dark-mode .skills-card,
body.dark-mode .project-card,
body.dark-mode .contact-form-container {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

/* Dark Mode: Timeline Text Fixes */
body.dark-mode .timeline-content p,
body.dark-mode .timeline-content ul,
body.dark-mode .timeline-content .institution {
    color: #ccc;
}

body.dark-mode .timeline-content .date {
    background-color: #333;
    color: #ddd;
}

/* Dark Mode: Projects Section Background */
body.dark-mode #projects {
    background-color: var(--background-color);
}

body.dark-mode #projects h2 {
    color: var(--accent-color);
}

body.dark-mode .timeline::before {
    background-color: #444;
}

body.dark-mode .tag {
    background-color: #2c3e50;
    color: #fff;
}

body.dark-mode .language-list li {
    border-bottom: 1px solid #333;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background-color: #2c2c2c;
    border-color: #444;
    color: var(--text-color);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--accent-color);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--accent-color);
    transform: rotate(15deg);
}

/* Hide/Show icons based on theme */
.theme-toggle .bi-moon-fill {
    display: none;
}

body.dark-mode .theme-toggle .bi-sun-fill {
    display: none;
}

body.dark-mode .theme-toggle .bi-moon-fill {
    display: inline-block;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

nav {
    width: 100%;
    height: var(--nav-height);
    background-color: var(--primary-color);
    position: fixed;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    align-items: center;
    display: flex;
}

.nav-links li {
    padding: 0 20px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    width: 24px;
    height: 24px;
    justify-content: space-between;
}

.burger div {
    width: 100%;
    height: 4px;
    background-color: var(--text-light);
    border-radius: 2px;
}

section {
    padding: 80px 20px;
    min-height: 100vh;
    scroll-margin-top: var(--nav-height);
    /* Fix for fixed header overlap */
}

#home {
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #34495e);
    color: var(--text-light);
    padding: 80px 40px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    width: 100%;
    max-width: 900px;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 0%;
    border: 4px solid var(--text-light);
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2em;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.cta-button {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.resume-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.resume-btn {
    background-color: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resume-btn:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Background Section (Timeline & Skills) */
.background-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin-top: 10px;
}

.timeline {
    flex: 2;
    min-width: 300px;
    position: relative;
    padding-left: 40px;
}

/* Vertical Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 0;
    width: 4px;
    background-color: #bdc3c7;
    /* Lighter grey for the line */
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    /* Animation trigger container */
}

.timeline-item.visible .timeline-dot {
    transform: scale(1);
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -40px;
    top: 5px;
    width: 24px;
    height: 24px;
    background-color: var(--card-bg-color);
    border: 4px solid var(--accent-color);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
    transform: scale(0);
    /* Initial state */
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.2);
    background-color: var(--accent-color);
}

.timeline-content {
    background-color: var(--card-bg-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
    border-left: 4px solid var(--accent-color);
    opacity: 0;
    /* Initial state */
    transform: translateX(30px);
    /* Initial state */
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.3em;
}

.timeline-content .institution {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.timeline-content .date {
    display: inline-block;
    background-color: #f0f0f0;
    color: #777;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.timeline-content p {
    margin-bottom: 0;
    color: #555;
}

.timeline-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-top: 10px;
    color: #555;
}

.timeline-content li {
    margin-bottom: 5px;
}

/* Skills Card */
.skills-card {
    flex: 1;
    min-width: 280px;
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    /* Sticky on desktop */
}

.skills-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

.skill-category {
    margin-bottom: 20px;
}

.skill-category strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Language List */
.language-list {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}

.language-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.language-list li:last-child {
    border-bottom: none;
}

.language-list strong {
    color: var(--text-color);
}

.language-list .level {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Tags/Badges */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: #e8f4f8;
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.tag:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

#projects {
    background-color: #fff;
}

#projects h2 {
    text-align: center;
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.projects-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 350px;
    border: 1px solid #eee;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
    color: var(--primary-color);
    transition: color 0.3s ease;
    margin-bottom: 10px;
}

.project-card a {
    text-decoration: none;
}

.project-card a:hover h3 {
    color: var(--accent-color);
}

.hashtags {
    display: block;
    margin-top: 15px;
    font-size: 0.9em;
}

.hashtags span {
    margin-right: 8px;
    color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

#contact {
    padding: 60px 20px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
}

#contact h2 {
    color: var(--text-light);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
}

#contact p {
    margin-bottom: 15px;
    opacity: 0.9;
}

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

#contact a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        height: 100vh;
        top: var(--nav-height);
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .nav-links li {
        opacity: 0;
        margin: 20px 0;
    }

    .burger {
        display: flex;
    }

    .project-card,
    .detail-card {
        width: 100%;
        max-width: 400px;
    }

    .hero h1 {
        font-size: 2em;
    }
}

.nav-active {
    transform: translateX(0);
}

.nav-links li {
    opacity: 1;
    transition: opacity 0.5s ease-in 0.2s;
}

/* Social Media Links Styling */
.social-media {
    margin-top: auto;
    padding-bottom: 40px;
}

.social-media .navbar-nav {
    display: flex;
    justify-content: center;
    list-style-type: none;
    align-items: center;
    gap: 20px;
}

.social-media .nav-link {
    color: var(--text-light);
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    display: block;
}

.social-media .nav-link:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

/* Details/Summary Styling */
details summary {
    list-style: none;
    cursor: pointer;
    font-weight: bold;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary:hover {
    background-color: #e9ecef;
}

details[open] summary {
    background-color: #e9ecef;
    margin-bottom: 15px;
}

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

.detail-card a:hover {
    text-decoration: underline;
}

/* Typing Animation Cursor */
.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--text-light);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
    height: 1em;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Contact Form Styling */
.contact-form-container {
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 40px auto 0;
    text-align: left;
    color: var(--text-color);
}

.contact-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.contact-form-container button {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
}

/* Expanded Project Card */
.project-card.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    z-index: 2000;
    cursor: default;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    background-color: var(--card-bg-color);
}

.project-card.expanded:hover {
    transform: translate(-50%, -50%);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Hide description and hashtags when expanded */
.project-card.expanded .card-content p,
.project-card.expanded .card-content .hashtags {
    display: none;
}

/* Keep title visible and style it */
.project-card.expanded .card-content h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
    text-align: center;
}

.simulation-container {
    flex: 1;
    width: 100%;
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

#inlineSimCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.close-sim-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    z-index: 10;
    transition: background 0.2s;
}

.close-sim-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sim-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Overlay for background when expanded */
.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    backdrop-filter: blur(3px);
    display: none;
}

.overlay-backdrop.active {
    display: block;
}

/* Play Now Button */
.play-btn {
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
}

.play-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Hide Play button when expanded */
.project-card.expanded .card-content .play-btn {
    display: none;
}

/* Project Card Image */
.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

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

/* Privacy Policy Styling */
.privacy-content {
    padding-top: 100px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 50px;
    padding-left: 20px;
    padding-right: 20px;
}

.privacy-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.privacy-content h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.privacy-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}