/*
 * Custom styles for Yash Saxena's portfolio
 * Built with Bootstrap 5.
 */

/*
 * Colour palette
 *
 * To support both light and dark themes the design uses CSS custom properties for
 * backgrounds, text and accent colours. The root variables define the light
 * theme, while the `.dark-mode` class on the body overrides the same
 * variables to produce a cohesive dark appearance. Additional variables (such
 * as card backgrounds and the hero background) make it easy to adjust the
 * aesthetics across multiple components without rewriting every rule.
 */
:root {
    /* Light theme colours */
    --bg-primary: #f4f6fa;          /* overall page background */
    --bg-section: #ffffff;          /* section panels */
    --card-bg: #ffffff;             /* cards and panels */
    --card-border: #e2e6f6;         /* subtle card border */
    --text-color: #243665;          /* dark navy text */
    --accent: #4c8bf5;              /* primary accent (blue) */
    --accent-2: #a65eea;            /* secondary accent (purple) */
    --navbar-bg: rgba(255, 255, 255, 0.8); /* semi‑transparent nav background */
    --hero-bg: url('hero-light.png');       /* light hero background image */
    --timeline-line-color: #4c8bf5; /* timeline line colour */
}

/* Dark theme overrides */
body.dark-mode {
    --bg-primary: #0b1d3a;          /* dark base background */
    --bg-section: #122448;          /* dark section panels */
    --card-bg: #142d57;             /* dark cards */
    --card-border: #1f3c6e;         /* dark borders */
    --text-color: #e9efff;          /* light text */
    --accent: #5aa9e6;              /* blue accent for dark */
    --accent-2: #b68cff;            /* violet accent for dark */
    --navbar-bg: rgba(11, 29, 58, 0.9); /* dark nav background */
    --hero-bg: url('hero-dark.png');        /* dark hero background image */
    --timeline-line-color: #5aa9e6; /* timeline line in dark */
}

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
}

section {
    position: relative;
    /* Each section inherits the appropriate background and text colours from the theme. */
    background-color: var(--bg-section);
    color: var(--text-color);
}

h2 {
    font-weight: 700;
}

.text-accent {
    color: var(--accent);
}
.bg-accent {
    background-color: var(--accent) !important;
    color: #fff !important;
}
.btn-accent {
    background-color: var(--accent);
    color: #fff;
    border: none;
}
/* When hovering or focusing on an accent button, switch to the secondary accent colour */
.btn-accent:hover,
.btn-accent:focus {
    background-color: var(--accent-2);
    color: #fff;
}

/* Outline accent buttons inherit the accent colour and reveal a filled background on hover */
.btn-outline-accent {
    color: var(--accent);
    border: 1px solid var(--accent);
    background-color: transparent;
}
.btn-outline-accent:hover,
.btn-outline-accent:focus {
    background-color: var(--accent);
    color: #fff;
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(4px);
}
.navbar-brand {
    color: var(--accent);
    font-size: 1.4rem;
}
.navbar-brand:hover {
    color: var(--accent);
}
.navbar .nav-link {
    color: var(--text-color);
    margin-right: 1rem;
    transition: color 0.2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--accent);
}

/* Hero Section */
#hero {
    /* Use CSS variables for the hero background so light/dark themes can swap images. The fallback background color ensures visibility if the image fails to load. */
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-section);
    min-height: 75vh;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    /* Provide extra space at the top to account for the fixed navbar */
    padding-top: 8rem;

    /* (no debug outline) */
}
#hero .lead {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
#hero .btn {
    min-width: 160px;
}
#hero .social-icons a {
    color: var(--accent);
    transition: color 0.3s;
}
#hero .social-icons a:hover {
    color: var(--accent-2);
}

/* Social icons outside the hero share the same accent colours */
.social-icons a {
    color: var(--accent);
    transition: color 0.3s;
}
.social-icons a:hover {
    color: var(--accent-2);
}

/* Skills */
.skills-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
}
.skills-card h5 {
    color: var(--accent);
    font-weight: 600;
}
.skills-card ul li {
    margin-bottom: 0.25rem;
    position: relative;
    padding-left: 1rem;
}
.skills-card ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1.2rem;
    width: 2px;
    background: var(--timeline-line-color);
    opacity: 0.3;
}
.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2.5rem;
}
.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    background: var(--accent);
    color: #fff;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.timeline-content h5 {
    color: var(--text-color);
    font-weight: 600;
}
.timeline-content ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}
.timeline-content ul li {
    margin-bottom: 0.3rem;
}
}

/* Project Cards */
.project-card {
    background-color: var(--card-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--card-border);
}
.project-card .project-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.project-card h5 {
    color: var(--text-color);
    font-weight: 600;
}
.project-card a {
    color: var(--accent);
}
.project-card a:hover {
    text-decoration: underline;
}

/* Publication Cards */
/* Publication Cards */
.publication-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
}
.publication-card a {
    color: var(--accent);
    text-decoration: none;
}
.publication-card a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}
.publication-card h6 {
    font-weight: 600;
    color: var(--accent);
}
.publication-card ul li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1rem;
}
.publication-card ul li::before {
    content: '\f111';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.5rem;
    top: 0.4rem;
}

/* Presentation Cards */
/* Presentation Cards */
.presentation-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
}
.presentation-card h5 {
    color: var(--text-color);
    font-weight: 600;
}
.presentation-card a {
    color: var(--accent);
}
.presentation-card a:hover {
    text-decoration: underline;
}

/* Awards */
.timeline-awards li {
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 1rem;
}
.timeline-awards li::before {
    content: '\f3c5'; /* award icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent);
    margin-right: 0.5rem;
    position: relative;
    left: -0.5rem;
}

/* Stats section styles */
.stats-section {
    background: var(--bg-section);
    padding: 4rem 0;
}
.counter-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}
.counter-card:hover {
    transform: translateY(-4px);
}
.counter-card .icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.counter-card .counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}
.counter-card p {
    margin: 0;
    color: var(--text-color);
}

/* Scroll to top button */
#scrollTopBtn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#scrollTopBtn.show {
    display: flex;
}
#scrollTopBtn:hover {
    background-color: var(--accent-2);
}

/* Footer */
footer {
    background-color: var(--bg-section);
    color: var(--text-color);
}
footer small {
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .timeline::before {
        left: 1rem;
    }
    .timeline-item {
        padding-left: 2.25rem;
    }
    #hero {
        padding-top: 4rem;
    }
}

/* Override Bootstrap's light background class to use theme variables */
.bg-light {
    background-color: var(--bg-section) !important;
    color: var(--text-color) !important;
}

/* Dark mode toggle button: ensure icon is visible and button is the right size */
#darkModeToggle {
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
#darkModeToggle i {
    font-size: 1.25rem;
}

/* Style for typed text in hero */
#typed-role {
    color: var(--accent-2);
    font-weight: 600;
    font-size: 1.5rem;
}

/* Research focus typed effect */
#research-typed {
    color: var(--accent-2);
    font-weight: 600;
    font-size: 1.25rem;
}

/* Profile Photo */
.profile-photo {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    object-fit: cover;
    border: 3px solid var(--card-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Research Focus cards */
.focus-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.focus-card:hover {
    /* When hovering, slightly elevate and add a shadow for depth.  Rotation is handled via JS on desktop. */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.focus-card .focus-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.focus-card h5 {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}
.focus-card p {
    color: var(--text-color);
    margin-bottom: 0;
    font-size: 0.9rem;
}