/* ============================================================
   Mohamed Ragab - Academic Portfolio Stylesheet
   Based on vsingh10.github.io design patterns
   ============================================================ */

/* ----------------------------------------------------------
   1. RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #000;
  color: #f5f5f5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  text-decoration: none;
  color: #8ab4f8;
  transition: color 0.3s ease;
}

a:hover {
  color: #a3bffa;
}

ul {
  list-style: none;
}

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

section {
  padding: 80px 5% 60px;
  max-width: 1200px;
  margin: 0 auto;
}

h2.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
  color: #f5f5f5;
  position: relative;
  transition: color 0.4s ease;
}

h2.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: #3b82f6;
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ----------------------------------------------------------
   2. NAVBAR
   ---------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0a0a0a;
  padding: 14px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  z-index: 1000;
  border-bottom: 1px solid #1a1a1a;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.navbar .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f5f5f5;
  letter-spacing: 0.5px;
  transition: color 0.4s ease;
}

.navbar .logo span {
  color: #8ab4f8;
  transition: color 0.4s ease;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: #ccc;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #8ab4f8;
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: #8ab4f8;
}

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

.nav-links a.active {
  color: #8ab4f8;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #f5f5f5;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ----------------------------------------------------------
   3. HERO BACKGROUND - Radial Dots + Flicker + Vignette
   ---------------------------------------------------------- */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, #1a1a2e 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
  animation: flicker 4s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes flicker {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    opacity: 0.45;
  }
}

.hero-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 40%, #000 100%);
  z-index: 1;
  pointer-events: none;
}

/* ----------------------------------------------------------
   4. PARTICLE BACKGROUND
   ---------------------------------------------------------- */
#tsparticles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ----------------------------------------------------------
   5. HERO SECTION
   ---------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 5% 80px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 50px;
  max-width: 1100px;
  width: 100%;
}

.hero-image {
  flex-shrink: 0;
}

.hero-image img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4),
              0 0 60px rgba(59, 130, 246, 0.15);
  border: 3px solid rgba(138, 180, 248, 0.3);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.hero-image img:hover {
  box-shadow: 0 0 35px rgba(59, 130, 246, 0.6),
              0 0 80px rgba(59, 130, 246, 0.25);
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #f5f5f5;
  transition: color 0.4s ease;
}

.hero-text h1 span {
  color: #8ab4f8;
  transition: color 0.4s ease;
}

.hero-text .subtitle {
  font-size: 1.15rem;
  color: #aaa;
  margin-bottom: 6px;
  transition: color 0.4s ease;
}

.hero-text .affiliation {
  font-size: 0.95rem;
  color: #999;
  margin-bottom: 20px;
  transition: color 0.4s ease;
}

.hero-quote {
  font-style: italic;
  color: #aaa;
  font-size: 0.95rem;
  margin-top: 16px;
  padding-left: 16px;
  border-left: 3px solid #3b82f6;
  animation: fadeInQuote 1.5s ease-out;
  transition: color 0.4s ease, border-color 0.4s ease;
}

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

/* ----------------------------------------------------------
   6. BUTTONS - CV Download & Social Expand
   ---------------------------------------------------------- */
.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  align-items: center;
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  color: #8ab4f8;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.btn-cv:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-2px);
}

.btn-cv i {
  font-size: 1rem;
}

.social-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 10px 14px;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ccc;
  font-size: 1rem;
  background: #0a0a0a;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  max-width: 44px;
  transition: max-width 0.4s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease, padding 0.3s ease;
}

.social-btn .social-label {
  opacity: 0;
  margin-left: 0;
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity 0.3s ease, margin-left 0.3s ease;
}

.social-btn:hover {
  max-width: 180px;
  padding: 10px 18px;
  border-color: #3b82f6;
  color: #8ab4f8;
  background: #111;
}

.social-btn:hover .social-label {
  opacity: 1;
  margin-left: 8px;
}

.social-btn i {
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* ----------------------------------------------------------
   7. ABOUT ME
   ---------------------------------------------------------- */
.about {
  position: relative;
  z-index: 2;
}

.about-grid {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-text p {
  color: #ccc;
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 16px;
  transition: color 0.4s ease;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-sidebar h3 {
  font-size: 1.1rem;
  color: #f5f5f5;
  margin-bottom: 12px;
  font-weight: 600;
  transition: color 0.4s ease;
}

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

.interest-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #111;
  color: #8ab4f8;
  font-size: 0.82rem;
  border-radius: 20px;
  border: 1px solid #1a1a2e;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.interest-tag:hover {
  background: #1a1a2e;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #ccc;
  padding: 6px 10px;
  background: #0a0a0a;
  border-radius: 6px;
  border: 1px solid #1a1a1a;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.skill-item i {
  color: #3b82f6;
  font-size: 0.9rem;
  transition: color 0.4s ease;
}

.skill-item:hover {
  border-color: #3b82f6;
  background: #111;
}

/* ----------------------------------------------------------
   8. EDUCATION - Cards with Tabs
   ---------------------------------------------------------- */
.education {
  position: relative;
  z-index: 2;
}

.education-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.edu-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.4s ease;
}

.edu-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
}

.edu-card .degree {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.edu-card .institution {
  font-size: 0.95rem;
  color: #8ab4f8;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.edu-card .year {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 12px;
  transition: color 0.4s ease;
}

.edu-card .details {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  transition: color 0.4s ease;
}

/* Education Tabs */
.edu-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #1a1a1a;
  transition: border-color 0.4s ease;
}

.edu-tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.edu-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  transition: background 0.3s ease;
}

.edu-tab-btn.active {
  color: #8ab4f8;
}

.edu-tab-btn.active::after {
  background: #3b82f6;
}

.edu-tab-btn:hover {
  color: #8ab4f8;
}

.edu-tab-content {
  display: none;
}

.edu-tab-content.active {
  display: block;
}

/* Courses Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.course-item {
  padding: 12px 16px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #ccc;
  transition: border-color 0.3s ease, background 0.4s ease, color 0.4s ease;
}

.course-item:hover {
  border-color: #3b82f6;
}

.course-item .course-code {
  color: #8ab4f8;
  font-weight: 600;
  margin-right: 6px;
  transition: color 0.4s ease;
}

/* ----------------------------------------------------------
   9. EXPERIENCE - Center Timeline, Flip Cards
   ---------------------------------------------------------- */
.experience {
  position: relative;
  z-index: 2;
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #3b82f6 0%, #1a1a2e 100%);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 20px 40px;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
  padding-right: 60px;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
  padding-left: 60px;
}

.timeline-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border-radius: 50%;
  top: 30px;
  z-index: 1;
  border: 3px solid #000;
  transition: border-color 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -7px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -7px;
}

/* Flip Card */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.flip-card-front .role {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.flip-card-front .company {
  font-size: 0.95rem;
  color: #8ab4f8;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.flip-card-front .period {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 10px;
  transition: color 0.4s ease;
}

.flip-card-front .summary {
  font-size: 0.88rem;
  color: #ccc;
  line-height: 1.5;
  transition: color 0.4s ease;
}

.flip-card-back p {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  transition: color 0.4s ease;
}

/* Experience Badges */
.exp-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #8ab4f8;
  font-size: 0.78rem;
  border-radius: 12px;
  margin: 4px 4px 0 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

.exp-badge:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* ----------------------------------------------------------
   10. PROJECTS - 2-Column Grid, Hover Lift
   ---------------------------------------------------------- */
.projects {
  position: relative;
  z-index: 2;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: #3b82f6;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.project-card .project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #7bd8ff;
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.project-card .project-title a {
  color: #7bd8ff;
  transition: color 0.3s ease;
}

.project-card .project-title a:hover {
  color: #a3bffa;
}

.project-card .project-desc {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 14px;
  transition: color 0.4s ease;
}

.project-card .project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card .project-tech span {
  padding: 3px 10px;
  background: #111;
  color: #8ab4f8;
  font-size: 0.78rem;
  border-radius: 12px;
  border: 1px solid #1a1a2e;
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

.project-card .project-links {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.project-card .project-links a {
  font-size: 0.85rem;
  color: #8ab4f8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s ease;
}

.project-card .project-links a:hover {
  color: #a3bffa;
}

/* ----------------------------------------------------------
   11. RESEARCH / PUBLICATIONS - Tabs & Cards
   ---------------------------------------------------------- */
.research {
  position: relative;
  z-index: 2;
}

.research-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 30px;
  justify-content: center;
  border-bottom: 2px solid #1a1a1a;
  transition: border-color 0.4s ease;
}

.research-tab-btn {
  padding: 12px 28px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.research-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  transition: background 0.3s ease;
}

.research-tab-btn.active {
  color: #8ab4f8;
}

.research-tab-btn.active::after {
  background: #3b82f6;
}

.research-tab-btn:hover {
  color: #8ab4f8;
}

.research-tab-content {
  display: none;
}

.research-tab-content.active {
  display: block;
}

/* Research Cards */
.research-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.research-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 22px 26px;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.4s ease;
}

.research-card:hover {
  border-color: #3b82f6;
  transform: translateX(4px);
}

.research-card .pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 6px;
  transition: color 0.4s ease;
}

.research-card .pub-title a {
  color: #7bd8ff;
  transition: color 0.3s ease;
}

.research-card .pub-title a:hover {
  color: #a3bffa;
}

.research-card .pub-authors {
  font-size: 0.88rem;
  color: #aaa;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.research-card .pub-venue {
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
  margin-bottom: 10px;
  transition: color 0.4s ease;
}

.research-card .pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.research-card .pub-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(59, 130, 246, 0.12);
  color: #8ab4f8;
  font-size: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  cursor: default;
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

.research-card .pub-tag:hover {
  background: rgba(59, 130, 246, 0.22);
}

.research-card .pub-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.research-card .pub-links a {
  font-size: 0.82rem;
  color: #8ab4f8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s ease;
}

.research-card .pub-links a:hover {
  color: #a3bffa;
}

/* ----------------------------------------------------------
   12. TEACHING & SERVICE (NEW SECTION)
   ---------------------------------------------------------- */
.teaching-service {
  position: relative;
  z-index: 2;
}

.teaching-service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* Teaching & Service Sub-sections */
.ts-block {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 28px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.ts-block h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.4s ease;
}

.ts-block h3 i {
  color: #3b82f6;
  font-size: 1.1rem;
  transition: color 0.4s ease;
}

/* Student Supervision Table/Cards */
.supervision-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.supervision-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  background: #111;
  border-radius: 8px;
  border: 1px solid #1a1a1a;
  transition: border-color 0.3s ease, background 0.4s ease;
}

.supervision-item:hover {
  border-color: #3b82f6;
}

.supervision-item .student-info {
  flex: 1;
}

.supervision-item .student-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 2px;
  transition: color 0.4s ease;
}

.supervision-item .student-topic {
  font-size: 0.85rem;
  color: #aaa;
  transition: color 0.4s ease;
}

.supervision-item .student-type {
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #8ab4f8;
  font-size: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Guest Lectures / Co-Teaching Lists */
.lecture-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lecture-item {
  padding: 12px 16px;
  background: #111;
  border-radius: 8px;
  border: 1px solid #1a1a1a;
  transition: border-color 0.3s ease, background 0.4s ease;
}

.lecture-item:hover {
  border-color: #3b82f6;
}

.lecture-item .lecture-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 2px;
  transition: color 0.4s ease;
}

.lecture-item .lecture-course {
  font-size: 0.85rem;
  color: #8ab4f8;
  transition: color 0.4s ease;
}

.lecture-item .lecture-date {
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
  transition: color 0.4s ease;
}

/* Service Badges */
.service-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #111;
  border: 1px solid #1a1a2e;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #ccc;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.4s ease, transform 0.3s ease;
}

.service-badge i {
  color: #3b82f6;
  font-size: 0.85rem;
  transition: color 0.4s ease;
}

.service-badge:hover {
  border-color: #3b82f6;
  background: #1a1a2e;
  transform: translateY(-2px);
}

.service-badge .badge-year {
  font-size: 0.75rem;
  color: #999;
  margin-left: 4px;
  transition: color 0.4s ease;
}

/* Teaching Courses (TA / Instructor) */
.teaching-courses {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teaching-course-item {
  padding: 12px 16px;
  background: #111;
  border-radius: 8px;
  border: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease, background 0.4s ease;
}

.teaching-course-item:hover {
  border-color: #3b82f6;
}

.teaching-course-item .course-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: #f5f5f5;
  transition: color 0.4s ease;
}

.teaching-course-item .course-role {
  font-size: 0.8rem;
  color: #8ab4f8;
  padding: 3px 10px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  transition: background 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

/* ----------------------------------------------------------
   13. AWARDS - Cards with Left Blue Border
   ---------------------------------------------------------- */
.awards {
  position: relative;
  z-index: 2;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.award-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
}

.award-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
}

.award-card .award-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 10px;
  color: #8ab4f8;
  font-size: 1.2rem;
  transition: background 0.3s ease, color 0.4s ease;
}

.award-card:hover .award-icon {
  background: rgba(59, 130, 246, 0.2);
}

.award-card .award-info {
  flex: 1;
}

.award-card .award-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.award-card .award-org {
  font-size: 0.88rem;
  color: #8ab4f8;
  margin-bottom: 2px;
  transition: color 0.4s ease;
}

.award-card .award-year {
  font-size: 0.8rem;
  color: #999;
  transition: color 0.4s ease;
}

.award-card .award-desc {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 6px;
  line-height: 1.5;
  transition: color 0.4s ease;
}

/* ----------------------------------------------------------
   14. CONTACT FOOTER
   ---------------------------------------------------------- */
.footer {
  background: #0a0a0a;
  padding: 50px 5%;
  text-align: center;
  border-top: 1px solid #1a1a1a;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.footer h2 {
  font-size: 1.5rem;
  color: #f5f5f5;
  margin-bottom: 16px;
  transition: color 0.4s ease;
}

.footer p {
  color: #999;
  font-size: 0.95rem;
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.footer .email-link {
  color: #8ab4f8;
  font-size: 1.05rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer .email-link:hover {
  color: #a3bffa;
}

.footer .footer-socials {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.footer .footer-socials a {
  color: #999;
  font-size: 1.2rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.footer .footer-socials a:hover {
  color: #8ab4f8;
  transform: translateY(-2px);
}

.footer .copyright {
  margin-top: 28px;
  font-size: 0.8rem;
  color: #666;
  transition: color 0.4s ease;
}

/* ----------------------------------------------------------
   15. THEME TOGGLE
   ---------------------------------------------------------- */
.theme-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e1f26;
  border: 2px solid #333;
  color: #f5f5f5;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: #3b82f6;
}

/* ----------------------------------------------------------
   16. LIGHT THEME - Complete Overrides
   ---------------------------------------------------------- */
body.light {
  background-color: #fdfdfd;
  color: #222;
}

/* Navbar - Light */
body.light .navbar {
  background: #fff;
  border-bottom-color: #e0e0e0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

body.light .navbar .logo {
  color: #222;
}

body.light .navbar .logo span {
  color: #3366cc;
}

body.light .nav-links a {
  color: #555;
}

body.light .nav-links a:hover,
body.light .nav-links a.active {
  color: #3366cc;
}

body.light .nav-links a::after {
  background: #3366cc;
}

body.light .nav-toggle {
  color: #222;
}

/* Hero - Light */
body.light .hero-bg {
  background-image: radial-gradient(circle, #d0d0e0 1px, transparent 1px);
  opacity: 0.3;
}

body.light .hero-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, #fdfdfd 100%);
}

body.light .hero-image img {
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.25),
              0 0 60px rgba(37, 99, 235, 0.1);
  border-color: rgba(51, 102, 204, 0.3);
}

body.light .hero-text h1 {
  color: #222;
}

body.light .hero-text h1 span {
  color: #3366cc;
}

body.light .hero-text .subtitle {
  color: #555;
}

body.light .hero-text .affiliation {
  color: #777;
}

body.light .hero-quote {
  color: #666;
  border-left-color: #2563eb;
}

/* Buttons - Light */
body.light .btn-cv {
  border-color: #2563eb;
  color: #2563eb;
}

body.light .btn-cv:hover {
  background: #2563eb;
  color: #fff;
}

body.light .social-btn {
  background: #f8f8f8;
  border-color: #ddd;
  color: #555;
}

body.light .social-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f0f4ff;
}

/* Section Titles - Light */
body.light h2.section-title {
  color: #222;
}

body.light h2.section-title::after {
  background: #2563eb;
}

/* About - Light */
body.light .about-text p {
  color: #444;
}

body.light .about-sidebar h3 {
  color: #222;
}

body.light .interest-tag {
  background: #f0f4ff;
  color: #2563eb;
  border-color: #d0daf0;
}

body.light .interest-tag:hover {
  background: #dde6f8;
  border-color: #2563eb;
}

body.light .skill-item {
  background: #f8f8f8;
  border-color: #e0e0e0;
  color: #444;
}

body.light .skill-item i {
  color: #2563eb;
}

body.light .skill-item:hover {
  border-color: #2563eb;
  background: #f0f4ff;
}

body.light .skills-grid {
  /* inherits layout */
}

/* Education - Light */
body.light .edu-card {
  background: #fff;
  border-color: #e0e0e0;
}

body.light .edu-card:hover {
  border-color: #2563eb;
}

body.light .edu-card .degree {
  color: #222;
}

body.light .edu-card .institution {
  color: #3366cc;
}

body.light .edu-card .year {
  color: #888;
}

body.light .edu-card .details {
  color: #444;
}

body.light .edu-tabs {
  border-bottom-color: #e0e0e0;
}

body.light .edu-tab-btn {
  color: #888;
}

body.light .edu-tab-btn.active {
  color: #2563eb;
}

body.light .edu-tab-btn.active::after {
  background: #2563eb;
}

body.light .edu-tab-btn:hover {
  color: #2563eb;
}

body.light .course-item {
  background: #f8f8f8;
  border-color: #e0e0e0;
  color: #444;
}

body.light .course-item:hover {
  border-color: #2563eb;
}

body.light .course-item .course-code {
  color: #2563eb;
}

/* Experience - Light */
body.light .timeline::before {
  background: linear-gradient(180deg, #2563eb 0%, #d0daf0 100%);
}

body.light .timeline-dot {
  background: #2563eb;
  border-color: #fdfdfd;
}

body.light .flip-card-front,
body.light .flip-card-back {
  background: #fff;
  border-color: #e0e0e0;
}

body.light .flip-card-front .role {
  color: #222;
}

body.light .flip-card-front .company {
  color: #3366cc;
}

body.light .flip-card-front .period {
  color: #888;
}

body.light .flip-card-front .summary {
  color: #444;
}

body.light .flip-card-back p {
  color: #444;
}

body.light .exp-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}

body.light .exp-badge:hover {
  background: rgba(37, 99, 235, 0.18);
}

/* Projects - Light */
body.light .project-card {
  background: #fff;
  border-color: #e0e0e0;
}

body.light .project-card:hover {
  border-color: #2563eb;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
}

body.light .project-card .project-title {
  color: #2563eb;
}

body.light .project-card .project-title a {
  color: #2563eb;
}

body.light .project-card .project-title a:hover {
  color: #3366cc;
}

body.light .project-card .project-desc {
  color: #444;
}

body.light .project-card .project-tech span {
  background: #f0f4ff;
  color: #2563eb;
  border-color: #d0daf0;
}

body.light .project-card .project-links a {
  color: #2563eb;
}

body.light .project-card .project-links a:hover {
  color: #3366cc;
}

/* Research - Light */
body.light .research-tabs {
  border-bottom-color: #e0e0e0;
}

body.light .research-tab-btn {
  color: #888;
}

body.light .research-tab-btn.active {
  color: #2563eb;
}

body.light .research-tab-btn.active::after {
  background: #2563eb;
}

body.light .research-tab-btn:hover {
  color: #2563eb;
}

body.light .research-card {
  background: #fff;
  border-color: #e0e0e0;
}

body.light .research-card:hover {
  border-color: #2563eb;
}

body.light .research-card .pub-title {
  color: #222;
}

body.light .research-card .pub-title a {
  color: #2563eb;
}

body.light .research-card .pub-title a:hover {
  color: #3366cc;
}

body.light .research-card .pub-authors {
  color: #555;
}

body.light .research-card .pub-venue {
  color: #777;
}

body.light .research-card .pub-tag {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}

body.light .research-card .pub-tag:hover {
  background: rgba(37, 99, 235, 0.15);
}

body.light .research-card .pub-links a {
  color: #2563eb;
}

body.light .research-card .pub-links a:hover {
  color: #3366cc;
}

/* Teaching & Service - Light */
body.light .ts-block {
  background: #fff;
  border-color: #e0e0e0;
}

body.light .ts-block h3 {
  color: #222;
}

body.light .ts-block h3 i {
  color: #2563eb;
}

body.light .supervision-item {
  background: #f8f8f8;
  border-color: #e0e0e0;
}

body.light .supervision-item:hover {
  border-color: #2563eb;
}

body.light .supervision-item .student-name {
  color: #222;
}

body.light .supervision-item .student-topic {
  color: #666;
}

body.light .supervision-item .student-type {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}

body.light .lecture-item {
  background: #f8f8f8;
  border-color: #e0e0e0;
}

body.light .lecture-item:hover {
  border-color: #2563eb;
}

body.light .lecture-item .lecture-title {
  color: #222;
}

body.light .lecture-item .lecture-course {
  color: #3366cc;
}

body.light .lecture-item .lecture-date {
  color: #888;
}

body.light .service-badge {
  background: #f8f8f8;
  border-color: #d0daf0;
  color: #444;
}

body.light .service-badge i {
  color: #2563eb;
}

body.light .service-badge:hover {
  border-color: #2563eb;
  background: #f0f4ff;
}

body.light .service-badge .badge-year {
  color: #888;
}

body.light .teaching-course-item {
  background: #f8f8f8;
  border-color: #e0e0e0;
}

body.light .teaching-course-item:hover {
  border-color: #2563eb;
}

body.light .teaching-course-item .course-name {
  color: #222;
}

body.light .teaching-course-item .course-role {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

/* Awards - Light */
body.light .award-card {
  background: #fff;
  border-color: #e0e0e0;
  border-left-color: #2563eb;
}

body.light .award-card:hover {
  border-color: #2563eb;
  border-left-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

body.light .award-card .award-icon {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

body.light .award-card:hover .award-icon {
  background: rgba(37, 99, 235, 0.15);
}

body.light .award-card .award-title {
  color: #222;
}

body.light .award-card .award-org {
  color: #3366cc;
}

body.light .award-card .award-year {
  color: #888;
}

body.light .award-card .award-desc {
  color: #555;
}

/* Footer - Light */
body.light .footer {
  background: #fff;
  border-top-color: #e0e0e0;
}

body.light .footer h2 {
  color: #222;
}

body.light .footer p {
  color: #666;
}

body.light .footer .email-link {
  color: #2563eb;
}

body.light .footer .email-link:hover {
  color: #3366cc;
}

body.light .footer .footer-socials a {
  color: #888;
}

body.light .footer .footer-socials a:hover {
  color: #2563eb;
}

body.light .footer .copyright {
  color: #aaa;
}

/* Theme Toggle - Light */
body.light .theme-toggle {
  background: #fff;
  border-color: #ddd;
  color: #222;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body.light .theme-toggle:hover {
  border-color: #2563eb;
}

/* General links - Light */
body.light a {
  color: #2563eb;
}

body.light a:hover {
  color: #3366cc;
}

/* ----------------------------------------------------------
   17. RESPONSIVE - max-width 768px
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  /* Navbar */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 8px 0;
    font-size: 1rem;
  }

  /* Hero */
  .hero {
    padding: 100px 5% 60px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .hero-image img {
    width: 160px;
    height: 160px;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-text .subtitle {
    font-size: 1rem;
  }

  .hero-quote {
    text-align: left;
  }

  .hero-buttons {
    justify-content: center;
  }

  .social-buttons {
    justify-content: center;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Education */
  .education-cards {
    grid-template-columns: 1fr;
  }

  .edu-tabs {
    flex-wrap: wrap;
  }

  .edu-tab-btn {
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  /* Experience - Left-align timeline */
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    text-align: left !important;
    padding-left: 50px !important;
    padding-right: 16px !important;
  }

  .timeline-item .timeline-dot {
    left: 13px !important;
    right: auto !important;
  }

  .flip-card:hover .flip-card-inner {
    transform: none;
  }

  .flip-card-back {
    position: relative;
    transform: none;
    margin-top: 12px;
    display: block;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Research */
  .research-tabs {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .research-tab-btn {
    padding: 10px 18px;
    font-size: 0.88rem;
  }

  /* Teaching & Service */
  .teaching-service-grid {
    grid-template-columns: 1fr;
  }

  .supervision-item {
    flex-direction: column;
    gap: 8px;
  }

  .supervision-item .student-type {
    margin-left: 0;
    align-self: flex-start;
  }

  .teaching-course-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  /* Awards */
  .awards-grid {
    grid-template-columns: 1fr;
  }

  /* Section titles */
  h2.section-title {
    font-size: 1.6rem;
    margin-bottom: 30px;
  }

  section {
    padding: 60px 5% 40px;
  }

  /* Footer */
  .footer {
    padding: 40px 5%;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   EXTRA: Small screens (480px)
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.6rem;
  }

  .hero-image img {
    width: 130px;
    height: 130px;
  }

  .btn-cv {
    padding: 8px 18px;
    font-size: 0.88rem;
  }

  .social-btn {
    padding: 8px 12px;
  }

  .navbar {
    padding: 10px 4%;
  }

  .navbar .logo {
    font-size: 1.1rem;
  }
}

/* ----------------------------------------------------------
   UTILITIES & ANIMATIONS
   ---------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

body.light ::-webkit-scrollbar-track {
  background: #f8f8f8;
}

body.light ::-webkit-scrollbar-thumb {
  background: #ccc;
}

body.light ::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* Selection highlight */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #f5f5f5;
}

body.light ::selection {
  background: rgba(37, 99, 235, 0.2);
  color: #222;
}
