/* Modern Clean Design System for Academic & Industry Portfolio */
/* Color Palette: RGB Graphics Inspired Theme (Red, Green, Blue) */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Background colors */
  --bg-primary: #ffffff;        /* Pure white for clean academic feel */
  --bg-secondary: #ffffff;      
  --bg-tertiary: #f8fafc;       /* Slate 50 for content dividers */
  
  /* Text colors */
  --text-primary: #0f172a;      /* Slate 900 */
  --text-secondary: #334155;    /* Slate 700 */
  --text-muted: #64748b;        /* Slate 500 */
  
  /* RGB Graphics Theme Accents */
  --color-r: #ef4444;           /* Red (Academic) */
  --color-r-hover: #dc2626;
  --color-r-light: #fee2e2;
  
  --color-g: #10b981;           /* Green (Personal Project) */
  --color-g-hover: #059669;
  --color-g-light: #d1fae5;
  
  --color-b: #3b82f6;           /* Blue (Industry/Base Accent) */
  --color-b-hover: #2563eb;
  --color-b-light: #dbeafe;
  
  /* Interface Base Colors */
  --primary-color: var(--color-b);
  --primary-hover: var(--color-b-hover);
  --primary-light: var(--color-b-light);
  
  /* Borders and elements */
  --border-color: #e2e8f0;      /* Slate 200 */
  --border-hover: #cbd5e1;      /* Slate 300 */
  
  /* Tag colors matching project type */
  --tag-academic-bg: var(--color-r-light);
  --tag-academic-text: #991b1b;
  --tag-personal-bg: var(--color-g-light);
  --tag-personal-text: #065f46;
  --tag-industry-bg: var(--color-b-light);
  --tag-industry-text: #1e3a8a;
  --tag-status-bg: #f1f5f9;
  --tag-status-text: #334155;
  
  /* Layout constraints */
  --max-width: 1300px;
  --sidebar-width: 290px;       /* Increased sidebar width to fit name and details */
  --border-radius: 8px;
  --border-radius-sm: 4px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.03), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  
  /* Transitions */
  --transition-smooth: all 0.2s ease-in-out;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 64px; /* Space for fixed navbar */
}

/* Navbar Styling */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.nav-brand span {
  display: inline-block;
  margin-right: 1px;
}

/* RGB brand logo colors */
.nav-logo-r { color: var(--color-r); }
.nav-logo-g { color: var(--color-g); }
.nav-logo-b { color: var(--color-b); }

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition-smooth);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link-item:hover {
  color: var(--primary-color);
}

/* App Container Layout */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Left Sidebar Styling (Minimalist, Left-Aligned) */
.sidebar {
  position: sticky;
  top: 110px; /* navbar height + padding */
  height: fit-content;
}

.profile-card {
  text-align: left; /* Left-aligned sidebar */
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}

.profile-card:hover {
  box-shadow: none;
}

.avatar-wrapper {
  width: 140px;
  height: 140px;
  margin: 0 0 24px 8px; /* Shifted slightly right (8px) for optical alignment with left-aligned text */
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.hide {
  display: none !important;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.profile-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap; /* Force name to stay on a single line */
}

.profile-school {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 500;
  line-height: 1.5;
}

.school-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Social links list: clean list structure */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  width: 100%;
  align-items: flex-start; /* Left-aligned */
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  background: none;
  border: none;
  transition: var(--transition-smooth);
  width: fit-content;
}

.social-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.social-link:hover {
  color: var(--primary-color);
  background: none;
  border: none;
}

.social-link:hover .social-icon {
  color: var(--primary-color);
  transform: translateY(-1px);
}

/* Main Content Area (Right Column) */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* Section Title */
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 24px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* About Me section (Minimalist borderless) */
.bio-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.bio-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* Projects & Publications layout */
.portfolio-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

/* Search and Filters */
.search-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* Search Box */
.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
  width: 16px;
  height: 16px;
}

.search-box input:focus + .search-icon {
  color: var(--primary-color);
}

/* Filter tabs/capsules */
.filter-tabs {
  display: flex;
  gap: 4px;
  background-color: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
}

.filter-tab {
  border: none;
  background: none;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: #ffffff;
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Timeline Layout (Year groupings) */
.projects-timeline {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

/* Soft transition entries for project lists */
@keyframes groupAppear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.projects-timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  animation: groupAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Project / Pub Card - Clean flat entry layout without card box */
.project-card {
  display: flex;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: var(--transition-smooth);
  height: auto;
  align-items: stretch; /* Stretch children vertically to align bottoms */
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  
  /* Initial state for micro-animation */
  opacity: 0;
  animation: groupAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.project-card:last-child {
  border-bottom: none;
}

.project-card:hover {
  /* Keep static flat entries clean without transformations */
  transform: none;
  box-shadow: none;
}

/* Card Thumbnail Container - Stretches vertically to match content bottom */
.card-thumbnail-container {
  width: 280px;
  min-width: 280px;
  min-height: 170px; /* Default height for short entries */
  position: relative;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  overflow: hidden;
  border-radius: 6px;
  align-self: stretch;
}

.card-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.card-thumbnail-img.fit-contain {
  object-fit: contain;
  background-color: #000000;
  padding: 12px;
}

/* handled by global .hide rule */

/* CSS fallback backgrounds based on project type (RGB inspired) */
.card-thumbnail-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
}

.fallback-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.fallback-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* R (Red) - Academic */
.fallback-academic {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  color: #b91c1c;
}
.fallback-academic .fallback-type { color: #dc2626; }

/* G (Green) - Personal */
.fallback-personal {
  background: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 100%);
  color: #047857;
}
.fallback-personal .fallback-type { color: #059669; }

/* B (Blue) - Industry */
.fallback-industry {
  background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
  color: #1e3a8a;
}
.fallback-industry .fallback-type { color: #2563eb; }

/* Card Content Details */
.card-content {
  display: flex;
  flex-direction: column;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.card-members {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.card-members strong {
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
}

/* Links footer styling */
.card-footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.tag-academic {
  background-color: var(--tag-academic-bg);
  color: var(--tag-academic-text);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.tag-personal {
  background-color: var(--tag-personal-bg);
  color: var(--tag-personal-text);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.tag-industry {
  background-color: var(--tag-industry-bg);
  color: var(--tag-industry-text);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.tag-year {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.tag-company {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-weight: 700;
}

.tag-status {
  background-color: var(--tag-status-bg);
  color: var(--tag-status-text);
}

.tag-keyword {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

/* Row 2: Capitalized Action Links */
.card-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.card-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  transition: var(--transition-smooth);
  letter-spacing: 0.02em;
}

/* Custom RGB-themed Link Hover colors based on card container type */
.project-card[data-type="academic"] .card-link:hover {
  color: var(--color-r-hover);
  background-color: var(--color-r-light);
  border-color: var(--color-r);
}

.project-card[data-type="personal"] .card-link:hover {
  color: var(--color-g-hover);
  background-color: var(--color-g-light);
  border-color: var(--color-g);
}

.project-card[data-type="industry"] .card-link:hover {
  color: var(--color-b-hover);
  background-color: var(--color-b-light);
  border-color: var(--color-b);
}

/* Loading and Empty states */
.loading-state, .empty-state {
  text-align: center;
  padding: 48px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-muted);
  font-weight: 500;
}


/* Personal Hobbies Styles */
.interests-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.personal-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.personal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.personal-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.icon-creative {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.icon-culture {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.icon-travel {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.personal-content {
  flex: 1;
}

.personal-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.personal-content p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.personal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Responsive Styles */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 20px 16px 40px;
    gap: 32px;
  }
  
  .sidebar {
    position: relative;
    top: 0;
  }
  
  .profile-card {
    padding: 0;
  }
  
  .avatar-wrapper {
    width: 120px;
    height: 120px;
  }
}


@media (max-width: 600px) {
  .project-card {
    flex-direction: column;
    height: auto;
    min-height: 0;
    align-items: stretch;
    padding: 16px 0;
    gap: 16px;
  }
  
  .card-thumbnail-container {
    width: 100%;
    height: 160px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
  }
  
  .card-thumbnail-img {
    border-radius: 6px;
  }
  
  .card-footer-links {
    width: 100%;
    justify-content: flex-start;
  }

  .personal-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
