/* 
   Dr. Rosha Bhandari - Academic Portfolio
   Design Style: Clean academic, medical blue tones, minimalist, generous spacing
*/

/* --- Variables --- */
:root {
    /* Colors - Light Theme */
    --primary-blue: #0A4275;
    /* Deep academic medical blue */
    --secondary-blue: #1A5F9A;
    --light-blue: #EBF3FA;
    /* Soft blue background */
    --hero-bg: #EBF3FA;
    /* Very subtle blue for light hero */

    --text-main: #334155;
    /* Slate 700 */
    --text-light: #64748B;
    /* Slate 500 */
    --heading-color: #0F172A;
    /* Slate 900 */
    --nav-text: #334155;

    --white: #ffffff;
    --bg-light: #F8FAFC;
    /* Slate 50 */
    --card-bg: #ffffff;

    --border-color: #E2E8F0;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --space-tight: 0.5rem;
    --space-base: 1rem;
    --space-loose: 2rem;
    --space-section: 6rem;

    /* Misc */
    --radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 12px rgba(26, 95, 154, 0.5);
    /* Glow shadow */
    --transition: all 0.3s ease-in-out;
}

[data-theme='dark'] {
    /* Colors - Dark Theme */
    --primary-blue: #4A90E2;
    /* Brighter blue for dark mode visibility */
    --secondary-blue: #63B3ED;
    --light-blue: rgba(74, 144, 226, 0.15);
    /* Soft transparent blue */
    --hero-bg: #0B1120;
    /* Deep dark blue for hero */

    --text-main: #CBD5E1;
    /* Slate 300 */
    --text-light: #94A3B8;
    /* Slate 400 */
    --heading-color: #F8FAFC;
    /* Slate 50 */
    --nav-text: #F8FAFC;

    --white: #0B1120;
    /* Essentially replacing white with dark bg */
    --bg-light: #0F172A;
    /* Slate 900 */
    --card-bg: #1E293B;
    /* Slate 800 */

    --border-color: #334155;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 12px rgba(99, 179, 237, 0.6);
    /* Glow shadow for dark */
}

/* --- Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition), color var(--transition);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    line-height: 1.3;
    font-weight: 600;
    transition: color var(--transition);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* --- Layout Utility --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-loose);
}

section {
    padding: var(--space-section) 0;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggering utility */
.delay-1 {
    transition-delay: 100ms;
}

.delay-2 {
    transition-delay: 200ms;
}

.delay-3 {
    transition-delay: 300ms;
}

.section-title {
    font-size: 2.25rem;
    color: var(--primary-blue);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

.section-title.text-center {
    text-align: center;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.subsection-title {
    font-size: 1.5rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light);
}

.mt-tight {
    margin-top: var(--space-tight);
}

.mt-base {
    margin-top: var(--space-base);
}

.mt-loose {
    margin-top: 3rem;
}

.ml-tight {
    margin-left: var(--space-tight);
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.icon {
    width: 24px;
    height: 24px;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    /* Use card-bg which has higher opacity in dark but similar to white in light */
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition), border-color var(--transition);
}

[data-theme='light'] .navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
}

[data-theme='dark'] .navbar {
    background-color: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--nav-text);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-blue);
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background-color: var(--light-blue);
}

.mobile-controls {
    display: none;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 99;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
}

.mobile-nav a {
    display: block;
    padding: 1rem var(--space-loose);
    color: var(--nav-text);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav a:hover {
    background-color: var(--light-blue);
    color: var(--primary-blue);
    text-decoration: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: #ffffff;
    border: 2px solid var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--secondary-blue);
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--light-blue);
    color: var(--secondary-blue);
    border-color: var(--secondary-blue);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

/* --- Home Section & Pills Background --- */
.home-section {
    position: relative;
    padding-top: 70px;
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--hero-bg);
    /* Applies medical blue aesthetic */
    overflow: hidden;
}

/* Base Light Blue Medical Gradient for Hero */
[data-theme='light'] .home-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0effc 100%);
}

[data-theme='dark'] .home-section {
    background: linear-gradient(135deg, #0f172a 0%, #0d2342 100%);
}

.pills-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Medicine Pills / Capsules Shapes */
.pill {
    position: absolute;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme='dark'] .pill {
    background: rgba(41, 58, 87, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Pill Variations - Different sizes, angles, and two-tone looks */
.pill-1 {
    width: 120px;
    height: 50px;
    top: 20%;
    left: 5%;
    transform: rotate(-15deg);
    background: linear-gradient(90deg, #ffffff 50%, var(--light-blue) 50%);
}

[data-theme='dark'] .pill-1 {
    background: linear-gradient(90deg, rgba(80, 120, 160, 0.5) 50%, rgba(30, 50, 80, 0.5) 50%);
}

.pill-2 {
    width: 80px;
    height: 35px;
    top: 60%;
    left: 15%;
    transform: rotate(45deg);
    background: linear-gradient(90deg, var(--primary-blue) 50%, #ffffff 50%);
    opacity: 0.7;
}

.pill-3 {
    width: 150px;
    height: 60px;
    top: 15%;
    right: 10%;
    transform: rotate(30deg);
    background: linear-gradient(90deg, #ffffff 50%, var(--light-blue) 50%);
    opacity: 0.8;
}

.pill-4 {
    width: 60px;
    height: 25px;
    bottom: 20%;
    right: 25%;
    transform: rotate(-40deg);
    background: linear-gradient(90deg, var(--light-blue) 50%, #ffffff 50%);
}

.pill-5 {
    width: 200px;
    height: 80px;
    bottom: -5%;
    left: 45%;
    transform: rotate(10deg);
    background: linear-gradient(90deg, var(--light-blue) 50%, transparent 50%);
    opacity: 0.3;
}

.hero-container {
    position: relative;
    z-index: 10;
    /* Above pills */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: calc(100vh - 70px);
}

.hero-image-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2%;
    width: 52%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
}

.hero-image {
    width: auto;
    height: 108%;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
    display: block;
}

.hero-content {
    width: 50%;
    padding-left: 2rem;
}

.hero-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-blue);
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.hero-role {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.hero-institution {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero-divider {
    width: 60px;
    height: 4px;
    background-color: var(--primary-blue);
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.hero-intro {
    font-size: 1.125rem;
    line-height: 1.8;
}

/* --- Grid Layouts --- */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* --- Cards --- */
.card,
.clean-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover,
.clean-card:hover {
    box-shadow: var(--shadow-md);
}

.clean-card {
    padding: 2rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header .icon {
    color: var(--primary-blue);
    width: 28px;
    height: 28px;
}

.card-header h3 {
    font-size: 1.5rem;
    margin: 0;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 6px;
    left: -1.5rem;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--primary-blue);
}

.timeline-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.timeline-date {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--primary-blue);
    background-color: var(--light-blue);
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* --- Clean Lists --- */
.clean-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}

.clean-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.grant-item {
    margin-bottom: 1.5rem;
}

.grant-item:last-child {
    margin-bottom: 0;
}

.grant-item h4 {
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

.grant-no {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* --- Research Section --- */
.academic-bib {
    padding-left: 1.5rem;
}

.academic-bib li {
    margin-bottom: 2rem;
    line-height: 1.7;
    color: var(--text-main);
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    list-style-position: inside;
}

.academic-bib li::marker {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.academic-bib li p {
    display: inline;
}

.citation-btn {
    display: inline-flex;
    margin-top: 1rem;
}

/* --- Teaching Media --- */
.channel-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.channel-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
}

.channel-link {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--heading-color);
    display: inline-flex;
    align-items: center;
}

.roles-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

/* Glowing Badges */
.badge {
    font-size: 0.875rem;
    background-color: var(--card-bg);
    color: var(--primary-blue);
    font-weight: 600;
    border: 1px solid var(--primary-blue);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    transition: var(--transition);
}

.glow-badge {
    box-shadow: var(--shadow-glow);
    animation: glow-pulse 3s infinite alternate;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 5px rgba(26, 95, 154, 0.2);
    }

    100% {
        box-shadow: var(--shadow-glow);
    }
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.video-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    color: inherit;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
    text-decoration: none;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: var(--transition);
}

.video-card:hover .video-thumbnail {
    opacity: 1;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.video-card:hover .play-overlay {
    background-color: #FF0000;
    /* YouTube Red */
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

.video-details {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.watch-link {
    font-size: 0.875rem;
    color: var(--primary-blue);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.watch-link::after {
    content: '→';
    transition: transform 0.2s;
}

.video-card:hover .watch-link::after {
    transform: translateX(4px);
}

.video-card:hover .watch-link {
    text-decoration: underline;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
}

a.contact-box:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    text-decoration: none;
}

.contact-icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: var(--light-blue);
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.contact-icon-wrapper .icon {
    width: 28px;
    height: 28px;
}

.contact-box h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.contact-box p {
    color: var(--text-light);
    font-size: 1rem;
}

/* --- Footer --- */
.footer {
    background-color: var(--hero-bg);
    /* Match hero for consistency */
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
    text-align: center;
    padding: 2.5rem 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        justify-content: flex-start;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-content {
        width: 100%;
        padding-left: 0;
        margin-bottom: 2rem;
    }

    .hero-image-wrapper {
        position: relative;
        width: 100%;
        height: 60vh;
        order: 2;
        /* Put image below text on mobile */
    }

    .hero-image {
        height: auto;
        max-width: 450px;
    }

    .hero-divider {
        margin: 1.5rem auto;
    }

    .hero-title {
        font-size: 3rem;
    }

    .pills-background {
        opacity: 0.6;
        /* less distracting on mobile */
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-controls {
        display: flex;
    }

    .grid-2-col,
    .video-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .channel-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .roles-badges {
        justify-content: center;
    }

    .contact-box {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-role {
        font-size: 1.25rem;
    }

    .card,
    .clean-card {
        padding: 1.5rem;
    }
}
