/* ==========================================================================
   Modern Academic Styling for Anil Palepu's Personal Website
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f1f5f9;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #0f172a;
  --primary-accent: #2563eb;
  --primary-accent-hover: #1d4ed8;
  
  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;
  --badge-border: #bfdbfe;
  
  --nature-badge-bg: #fef2f2;
  --nature-badge-text: #b91c1c;
  --nature-badge-border: #fecaca;
  
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Container Layout */
.site-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  display: flex;
  gap: 36px;
}

@media (max-width: 900px) {
  .site-wrapper {
    flex-direction: column;
    padding: 16px 16px 40px;
    gap: 24px;
  }
}

/* Sidebar */
.site-sidebar {
  width: 290px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .site-sidebar {
    width: 100%;
  }
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 24px;
  text-align: center;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.profile-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.profile-affiliations {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-affiliations strong {
  color: var(--text-main);
}

/* Social Icons */
.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.social-link-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-link-item a:hover {
  background: var(--primary-accent);
  color: #ffffff;
  border-color: var(--primary-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Main Content Area */
.site-main {
  flex-grow: 1;
  min-width: 0;
}

/* Navigation Tabs */
.nav-tabs-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  overflow-x: auto;
  gap: 6px;
  scrollbar-width: none;
}

.nav-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-tab-item {
  display: inline-block;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-tab-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
  text-decoration: none;
}

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

/* Content Sections */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .content-card {
    padding: 20px 16px;
  }
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-subheading {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
  border: none;
}

/* Bio Paragraphs */
.bio-content p {
  margin-bottom: 18px;
  line-height: 1.7;
}

.bio-content ul {
  margin: 0 0 20px 24px;
  line-height: 1.7;
}

.bio-content li {
  margin-bottom: 10px;
}

/* Highlights Box */
.highlight-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.pillar-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pillar-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary-accent);
}

.pillar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.pillar-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Timeline / News */
.timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary-accent);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.timeline-content {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Paper / Publication Card */
.publication-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: all 0.2s ease;
}

.paper-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.paper-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}

.paper-title a {
  color: var(--primary);
  text-decoration: none;
}

.paper-title a:hover {
  color: var(--primary-accent);
}

.paper-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.45;
}

.paper-authors strong {
  color: var(--primary);
}

.paper-venue {
  font-size: 0.88rem;
  font-style: italic;
  color: #334155;
  margin-bottom: 10px;
}

.paper-abstract {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.paper-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.3;
}

.badge.type-badge {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge.venue-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: var(--bg-hover);
  border-color: #cbd5e1;
  color: var(--primary-accent);
  text-decoration: none;
}

.btn-action.btn-primary-action {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-action.btn-primary-action:hover {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  color: #ffffff;
}

/* Project Cards */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.project-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-accent);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.project-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-summary {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-details-list {
  margin: 0 0 20px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.project-details-list li {
  margin-bottom: 8px;
}

.project-media {
  margin: 20px 0;
  text-align: center;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.project-media img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.project-media-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

/* CV Layout */
.cv-section {
  margin-bottom: 32px;
}

.cv-section:last-child {
  margin-bottom: 0;
}

.cv-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 18px;
}

.cv-item {
  margin-bottom: 18px;
}

.cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.cv-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.cv-item-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cv-item-subtitle {
  font-size: 0.9rem;
  color: var(--primary-accent);
  margin-bottom: 6px;
}

.cv-item-details {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.skills-group {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.skills-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

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

.skill-tag {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 0 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Print Styles */
@media print {
  body {
    background: #ffffff;
    font-size: 12pt;
  }
  .site-sidebar, .nav-tabs-wrapper, .social-links, .btn-action {
    display: none !important;
  }
  .site-wrapper {
    display: block;
    max-width: 100%;
    padding: 0;
  }
  .content-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
