/*
 * Portfolio Website Stylesheet
 *
 * This stylesheet defines the visual appearance of your portfolio website.
 * It uses CSS custom properties (variables) to make it easy to switch
 * between light and dark themes and to adjust accent colours in one
 * place. The layout is responsive, meaning it will adapt gracefully to
 * different screen sizes (mobile, tablet, desktop). Feel free to tweak
 * values such as colours, spacing and typography to match your personal
 * branding.
 */

/* Root variables for light theme */
:root {
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --background-color: #ffffff;
    --section-bg: #f6f7f9;
    --text-color: #1a1a1a;
    --heading-color: #0d47a1;
    --primary-color: #1565c0;
    --accent-color: #03a9f4;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark theme variables override the defaults when body has .dark-theme */
body.dark-theme {
    --background-color: #0d1b2a;
    --section-bg: #172c3c;
    --text-color: #f1f1f1;
    --heading-color: #90caf9;
    --primary-color: #2196f3;
    --accent-color: #64b5f6;
    --card-bg: #1e3a53;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

img {
    max-width: 100%;
    display: block;
}

/* Container utility class */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    /* Use white for the logo text in the hero section */
    color: #ffffff;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    /* White text for the navigation items overlaying the hero image */
    color: #ffffff;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Theme toggle button */
/* Theme toggle button */
#theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    background-color: var(--primary-color);
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    color: #ffffff;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* When dark theme is active, change navbar text colours to match the main text colour */
body.dark-theme .navbar .logo,
body.dark-theme .nav-links a,
body.dark-theme #theme-toggle {
    color: var(--text-color);
}

/* In dark theme, ensure the toggle button retains the accent background */
body.dark-theme #theme-toggle {
    background-color: var(--primary-color);
    color: #ffffff;
}

#theme-toggle i {
    font-size: 1rem;
}

.theme-toggle-label {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Hero section */
#hero {
    height: 100vh;
    background-image: url('img/hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

/* Dark overlay for readability */
#hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero-content .highlight {
    color: var(--accent-color);
}

.hero-content .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #e0f7fa;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

/* Sections */
.section {
    padding: 4rem 0;
}

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

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* About section */
.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.about-image {
    flex: 1 1 250px;
    text-align: center;
}

.about-image img {
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover;
}

.about-text {
    flex: 2 1 300px;
    font-size: 1rem;
}

/* Skills section */
.skills-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.skill-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.skill-card i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card:hover {
    transform: translateY(-4px);
}

/* Projects section */
.projects-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-card h3 {
    margin: 1rem;
    font-size: 1.3rem;
}

.project-card p {
    margin: 0 1rem 1rem;
    flex-grow: 1;
}

.project-link {
    margin: 0 1rem 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-color);
}

/* Timeline / Experience section */
.timeline {
    position: relative;
    margin: 2rem 0;
    --timeline-offset: 2.75rem;
    padding-left: var(--timeline-offset);
    border-left: 3px solid var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-9px - var(--timeline-offset));
    top: 0.35rem;
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--background-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Contact section */
.contact-details {
    margin-top: 1.5rem;
}

.contact-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.contact-details i {
    color: var(--primary-color);
}

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

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

/* Achievements grid styles */
.achievements-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.achievement-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.achievement-card i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.achievement-card:hover {
    transform: translateY(-4px);
}

/* Blog grid styles */
.blog-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.blog-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-card h3 {
    margin: 1rem;
    font-size: 1.3rem;
}

.blog-card p {
    margin: 0 1rem 1rem;
    flex-grow: 1;
}

.blog-card a {
    margin: 0 1rem 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Footer */
footer {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1rem 0;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    #hero { padding-top: 5rem; } /* keeps hero text clear of the fixed bar */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: rgba(0,0,0,0.8);
        padding: 0.85rem 1.25rem;
    }
    .menu-toggle { display: inline-flex; align-items: center; }
    #theme-toggle { position: static; margin-left: auto; }
    .nav-links {
        position: absolute;
        top: 100%;
        right: 1rem;
        left: 1rem;
        display: none;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        background: rgba(0,0,0,0.9);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }
    .nav-links[data-open="true"] { display: flex; }
}

/* Responsive adjustments
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        background-color: rgba(0, 0, 0, 0.6);
        padding: 1rem;
    }
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }
    .nav-links a {
        color: #fff;
    }
    #theme-toggle {
        margin-top: 1rem;
        color: #fff;
    }
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .about-image img {
        margin: 0 auto;
    }
} */
