/* Modern Portfolio Style - Refined Color Scheme */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0d9488;
  --accent-light: #14b8a6;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
}

[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-dark: #93bbfd;
  --accent: #2dd4bf;
  --accent-light: #5eead4;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --border: #334155;
  --border-light: #1e293b;
}

[data-theme="dark"] strong {
  color: #e2e8f0;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .fa-sun {
  display: none;
}

.theme-toggle .fa-moon {
  display: inline;
}

[data-theme="dark"] .theme-toggle .fa-sun {
  display: inline;
}

[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Layout - Single Column Centered */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1000px;
  /* Increased to accommodate sidebar */
  margin: 0 auto;
  padding: 0 20px;
}

/* Profile Header Section */
header {
  text-align: center;
  padding: 40px 0 20px;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.site-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.site-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  font-size: 1.3rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.social-icon:hover {
  color: var(--bg-card);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Navigation - Horizontal Tab Bar */
nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav ul li {
  display: inline-block;
}

.nav-heading {
  display: none;
}

nav .nav-item {
  display: inline-block;
  padding: 12px 20px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

nav .nav-item:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

nav .nav-item.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* Main Content */
main {
  flex: 1;
  padding: 0 0 40px;
}

.container {
  max-width: 100%;
}

/* Section Headers */
h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 30px 0 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 20px;
}

.footnote {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* Lists */
ul,
ol {
  margin: 0 0 20px 25px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

li strong {
  color: #222;
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  margin-top: 40px;
  border-top: 1px solid #ddd;
}

footer p {
  font-size: 0.9rem;
  color: #888;
}

/* Tables */
.academic-table,
.courses-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0 25px;
  font-size: 0.95rem;
}

.academic-table th,
.academic-table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #ddd;
}

.academic-table th {
  background: var(--border-light);
  font-weight: 600;
  color: var(--text-primary);
}

.academic-table tr:hover {
  background: var(--border-light);
}

.courses-table td {
  padding: 8px 12px;
  text-align: center;
  border: 1px solid #ddd;
}

/* Date spans */
.date {
  font-weight: normal;
  font-size: 0.9rem;
  color: #666;
  float: right;
}

/* Page with Sidebar Layout */
.page-with-sidebar {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.page-sidebar {
  position: sticky;
  top: 20px;
  width: 200px;
  flex-shrink: 0;
  padding-right: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  /* Scrollbar styling for sidebar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Custom scrollbar for webkit */
.page-sidebar::-webkit-scrollbar {
  width: 4px;
}

.page-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.page-content {
  flex: 1;
  min-width: 0;
}

.sidebar-subnav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-subnav .sidebar-link {
  padding-left: 28px;
  font-size: 0.85rem;
}



/* Project Cards */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project-header {
  margin-bottom: 16px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-card h2 {
  font-size: 1.3rem;
  margin: 0;
  padding: 0;
  border: none;
  color: var(--text-primary);
}

.project-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #ccfbf1;
  color: #0d9488;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
}

.project-badge.award {
  background: #fef3c7;
  color: #d97706;
}

[data-theme="dark"] .project-badge {
  background: #134e4a;
  color: #5eead4;
}

[data-theme="dark"] .project-badge.award {
  background: #451a03;
  color: #fbbf24;
}

[data-theme="dark"] .project-link {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
}

[data-theme="dark"] .project-link:hover {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

[data-theme="dark"] .project-tag {
  color: #94a3b8;
}

[data-theme="dark"] .project-objective {
  background: #1e293b;
  border: 1px solid #334155;
}

.project-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.project-org {
  color: var(--text-secondary);
}

.project-date {
  color: var(--text-muted);
}

.project-objective {
  background: var(--border-light);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.project-card ul {
  margin: 0 0 16px 20px;
}

.project-card li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.project-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--border-light);
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.project-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.project-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Hero Section */
.hero {
  margin-bottom: 20px;
}

.hero h1 {
  border-bottom: 1px solid #ddd;
}

.lead {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.7);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin: 0 0 10px;
}

.card p {
  font-size: 0.95rem;
  margin: 0;
  color: #555;
}

/* Contact Section */
.contact-section {
  margin-top: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-item i {
  color: #555;
  width: 20px;
}

/* Form */
.contact-form {
  margin-top: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  max-width: 450px;
  padding: 12px 15px;
  font-size: 1rem;
  font-family: inherit;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0066cc;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #0052a3;
}

/* Utilities */
.text-center {
  text-align: center;
}

/* Responsive */
@media (max-width: 850px) {
  .site-title {
    font-size: 2rem;
  }

  .site-subtitle {
    font-size: 1rem;
    padding: 0 10px;
  }

  .profile-image {
    width: 120px;
    height: 120px;
  }

  nav .nav-item {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .wrapper {
    padding: 0 16px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Sticky sidebar converts to horizontal scroll menu */
  .page-with-sidebar {
    flex-direction: column;
    gap: 20px;
  }

  .page-sidebar {
    position: sticky;
    top: 0;
    min-width: unset;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 10px 0;
    background: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }

  .sidebar-nav {
    display: flex;
    border-left: none;
    border-bottom: none;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
    margin: 0;
    width: 100%;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  /* Constrain text content on mobile */
  .page-content,
  .page-content p,
  .page-content ul,
  .page-content li,
  .site-title,
  .site-subtitle {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav>li {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .sidebar-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin: 0;
    padding: 6px 0;
    white-space: nowrap;
    font-size: 0.95rem;
  }

  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    color: var(--accent);
  }

  /* Show nested subnavs inline on mobile */
  .sidebar-subnav {
    display: flex;
    gap: 16px;
    padding-left: 0;
    margin: 0;
  }

  .sidebar-subnav .sidebar-link {
    padding-left: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
  }

  .sidebar-subnav .sidebar-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }


  /* Make tables scrollable */
  .academic-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Project cards adjustments */
  .project-card {
    padding: 20px;
  }

  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .project-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-link {
    width: 100%;
    justify-content: center;
  }
}