/* Shared Styles for All Pages */
/* This file contains common styles used across all pages */

/* CSS Variables */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #3498db;
    --text-light: #e0e0e0;
    --text-dark: #333;
    --card-bg-dark: rgba(255, 255, 255, 0.05);
    --transition-speed: 0.3s;
}

/* Animated Background */
body {
    position: relative;
    background: linear-gradient(135deg, #1a365d 0%, #2d3e50 100%);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    min-height: 100vh;
}

/* ===== Carbon-materials background =====
   Two inline-SVG layers (no extra network requests) reflecting the
   research itself:
     ::before — sp2 honeycomb lattice (graphene / graphene oxide sheet)
     ::after  — sparse sp3 tetrahedral carbon units (diamond)
   The lattice tile is exactly 102 x 58.89 px, so translating by one whole
   tile makes the drift loop invisibly. Transform/opacity are animated
   (not background-position) so the compositor handles both layers. */
body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
}

body::before {
    /* oversized by one tile all round so the drift never exposes an edge */
    top: -102px;
    left: -102px;
    width: calc(100% + 204px);
    height: calc(100% + 204px);
    background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='102'%20height='58.89'%20viewBox='0%200%20102%2058.89'%3E%3Cpath%20fill='none'%20stroke='%233E5F8A'%20stroke-width='1.1'%20stroke-linecap='round'%20d='M-17%2029.445L17%2029.445M17%20-29.445L34%200M17%2029.445L34%200M17%2029.445L34%2058.89M17%2088.335L34%2058.89M34%200L68%200M34%2058.89L68%2058.89M68%200L85%20-29.445M68%200L85%2029.445M68%2058.89L85%2029.445M68%2058.89L85%2088.335M85%2029.445L119%2029.445'/%3E%3Cg%20fill='%235B86B8'%3E%3Ccircle%20cx='17'%20cy='29.445'%20r='1.9'/%3E%3Ccircle%20cx='34'%20cy='0'%20r='1.9'/%3E%3Ccircle%20cx='34'%20cy='58.89'%20r='1.9'/%3E%3Ccircle%20cx='68'%20cy='0'%20r='1.9'/%3E%3Ccircle%20cx='68'%20cy='58.89'%20r='1.9'/%3E%3Ccircle%20cx='85'%20cy='29.445'%20r='1.9'/%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.22;
    animation: driftLattice 75s linear infinite;
    will-change: transform;
}

body::after {
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='960'%20height='800'%20viewBox='0%200%20960%20800'%3E%3Cg%20fill='none'%20stroke='%233E5F8A'%3E%3Cpath%20d='M165%2092L114.771%20179L215.229%20179Z'%20stroke-width='0.9'%20stroke-opacity='0.5'/%3E%3Cpath%20d='M165%20150L165%2092M165%20150L114.771%20179M165%20150L215.229%20179M165%20150L165%20174.36'%20stroke-width='1.6'%20stroke-linecap='round'/%3E%3C/g%3E%3Cg%20fill='%235B86B8'%3E%3Ccircle%20cx='165'%20cy='92'%20r='4.35'/%3E%3Ccircle%20cx='114.771'%20cy='179'%20r='4.35'/%3E%3Ccircle%20cx='215.229'%20cy='179'%20r='4.35'/%3E%3Ccircle%20cx='165'%20cy='174.36'%20r='4.93'/%3E%3Ccircle%20cx='165'%20cy='150'%20r='6.09'/%3E%3C/g%3E%3Cg%20fill='none'%20stroke='%233E5F8A'%3E%3Cpath%20d='M669.663%20219.323L660.611%20305.451L739.726%20270.226Z'%20stroke-width='0.9'%20stroke-opacity='0.5'/%3E%3Cpath%20d='M690%20265L669.663%20219.323M690%20265L660.611%20305.451M690%20265L739.726%20270.226M690%20265L698.541%20284.184'%20stroke-width='1.6'%20stroke-linecap='round'/%3E%3C/g%3E%3Cg%20fill='%235B86B8'%3E%3Ccircle%20cx='669.663'%20cy='219.323'%20r='3.75'/%3E%3Ccircle%20cx='660.611'%20cy='305.451'%20r='3.75'/%3E%3Ccircle%20cx='739.726'%20cy='270.226'%20r='3.75'/%3E%3Ccircle%20cx='698.541'%20cy='284.184'%20r='4.25'/%3E%3Ccircle%20cx='690'%20cy='265'%20r='5.25'/%3E%3C/g%3E%3Cg%20fill='none'%20stroke='%233E5F8A'%3E%3Cpath%20d='M403.976%20492.84L337.84%20558.976L428.184%20583.184Z'%20stroke-width='0.9'%20stroke-opacity='0.5'/%3E%3Cpath%20d='M390%20545L403.976%20492.84M390%20545L337.84%20558.976M390%20545L428.184%20583.184M390%20545L384.13%20566.907'%20stroke-width='1.6'%20stroke-linecap='round'/%3E%3C/g%3E%3Cg%20fill='%235B86B8'%3E%3Ccircle%20cx='403.976'%20cy='492.84'%20r='4.05'/%3E%3Ccircle%20cx='337.84'%20cy='558.976'%20r='4.05'/%3E%3Ccircle%20cx='428.184'%20cy='583.184'%20r='4.05'/%3E%3Ccircle%20cx='384.13'%20cy='566.907'%20r='4.59'/%3E%3Ccircle%20cx='390'%20cy='545'%20r='5.67'/%3E%3C/g%3E%3Cg%20fill='none'%20stroke='%233E5F8A'%3E%3Cpath%20d='M825.432%20654.762L839.267%20733.226L900.301%20682.012Z'%20stroke-width='0.9'%20stroke-opacity='0.5'/%3E%3Cpath%20d='M855%20690L825.432%20654.762M855%20690L839.267%20733.226M855%20690L900.301%20682.012M855%20690L867.419%20704.8'%20stroke-width='1.6'%20stroke-linecap='round'/%3E%3C/g%3E%3Cg%20fill='%235B86B8'%3E%3Ccircle%20cx='825.432'%20cy='654.762'%20r='3.45'/%3E%3Ccircle%20cx='839.267'%20cy='733.226'%20r='3.45'/%3E%3Ccircle%20cx='900.301'%20cy='682.012'%20r='3.45'/%3E%3Ccircle%20cx='867.419'%20cy='704.8'%20r='3.91'/%3E%3Ccircle%20cx='855'%20cy='690'%20r='4.83'/%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.24;
    animation: breatheSp3 22s ease-in-out infinite;
}

/* one full lattice tile — start and end frames are identical geometry */
@keyframes driftLattice {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(102px, 58.89px, 0); }
}

@keyframes breatheSp3 {
    0%, 100% { opacity: 0.20; }
    50%      { opacity: 0.34; }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

/* Performance: CSS Containment */
section {
    contain: layout style;
}

/* Navigation Styles */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(19, 42, 70, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

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

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover:after,
.nav-links a.active:after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Container */
.container {
    background: rgba(26, 54, 93, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 2rem;
    margin: 0 auto;
    max-width: 1200px;
}

/* Header Styles */
header {
    /* slightly translucent so the carbon lattice behind it stays readable */
    background: rgba(19, 42, 70, 0.72);
    padding: 3rem 0;
    position: relative;
    margin-top: 60px;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header-content img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(52, 152, 219, 0.8);
    box-shadow: 0 0 25px rgba(52, 152, 219, 0.5);
    transition: transform 0.5s, box-shadow 0.5s;
}

.header-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(52, 152, 219, 0.7);
}

.header-content h1 {
    margin: 1rem 0 0.5rem;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Contact Numbers in Header */
.contact-numbers {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-numbers a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-numbers a i {
    font-size: 1.1rem;
    color: #25D366;
}

.contact-numbers a:hover {
    background: rgba(37, 211, 102, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    border-color: rgba(37, 211, 102, 0.5);
}

/* Bio Card */
.bio-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    contain: layout style paint;
}

/* Project Card */
.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 3px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
    contain: layout style paint;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.project-card h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.project-meta {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-features {
    list-style: none;
    padding: 0;
}

.project-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.project-features li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.date-tag {
    display: inline-block;
    background: rgba(52, 152, 219, 0.2);
    color: var(--accent-color);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Section Title */
section h2 {
    color: var(--text-light);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    background: rgba(26, 54, 93, 0.9);
}

footer .tagline {
    font-style: italic;
    margin-top: 1rem;
    font-size: 0.9rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    border: none;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--secondary-color);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: background 0.3s, transform 0.3s;
    border: none;
    z-index: 1000;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Fade in animation */
.fade-in {
    animation: fadeInAnimation 0.8s ease forwards;
}

@keyframes fadeInAnimation {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text center utility */
.text-center {
    text-align: center;
}

/* Page Title */
.page-title {
    text-align: center;
    padding: 2rem 0;
}

.page-title h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        background: rgba(19, 42, 70, 0.95);
        backdrop-filter: blur(10px);
        width: 80%;
        height: calc(100vh - 60px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        transition: right 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .header-content img {
        width: 150px;
        height: 150px;
    }

    .container {
        width: 95%;
        padding: 1rem;
    }

    .contact-numbers {
        flex-direction: column;
        gap: 0.75rem;
    }

    .contact-numbers a {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .header-content img {
        width: 120px;
        height: 120px;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .theme-toggle,
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 20px;
    }

    .theme-toggle {
        left: 20px;
    }

    .scroll-to-top {
        right: 20px;
    }
}

/* ===== Page Transition Animations ===== */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageEnter 0.5s ease-out;
}

/* View Transitions API (progressive enhancement) */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.3s ease-out both fade-out;
}

::view-transition-new(root) {
    animation: 0.3s ease-in both fade-in;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Light Theme Refinement ===== */
.light-theme {
    --primary-color: #2563eb;
    --secondary-color: #059669;
    --accent-color: #2563eb;
    --text-light: #1e293b;
    --text-dark: #475569;
    --card-bg-dark: rgba(255, 255, 255, 0.85);
}

body.light-theme {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf4 50%, #f5f3ff 100%);
}

body.light-theme::before {
    opacity: 0.04;
}

.light-theme .nav-container {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.light-theme .nav-links a {
    color: #334155;
}

.light-theme .nav-links a:hover,
.light-theme .nav-links a.active {
    color: var(--primary-color);
}

.light-theme .logo span {
    color: #1e293b;
}

.light-theme header {
    background: rgba(255, 255, 255, 0.85);
}

.light-theme .header-content img {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.2);
}

.light-theme .container {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
}

.light-theme .bio-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.light-theme .project-card {
    background: rgba(255, 255, 255, 0.85);
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.light-theme .project-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.light-theme .project-card h3 {
    color: #1e293b;
}

.light-theme .project-meta {
    color: #64748b;
}

.light-theme .date-tag {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.light-theme .project-features li {
    color: #334155;
}

.light-theme .social-links a {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}

.light-theme .social-links a:hover {
    background: var(--primary-color);
    color: white;
}

.light-theme .contact-numbers a {
    background: rgba(0, 0, 0, 0.04);
    color: #334155;
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .tagline {
    color: #64748b;
}

.light-theme footer {
    background: rgba(248, 250, 252, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.light-theme footer p {
    color: #64748b;
}

.light-theme .footer-content .tagline {
    color: #94a3b8;
}

.light-theme .scroll-to-top,
.light-theme .theme-toggle {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.light-theme .page-title p {
    color: #64748b;
}

.light-theme .page-title h1 {
    background: linear-gradient(90deg, #2563eb, #059669);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Light theme for nav mobile overlay */
.light-theme .nav-links {
    background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
    .light-theme .nav-links {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }
}
