/* Reset & Base */
:root {
  --bg-color: #1a1b1e;
  --card-bg: #25262b;
  --text-primary: #c1c2c5;
  --text-secondary: #909296;
  --text-heading: #ffffff;
  --accent: #eee;
  --border: #373a40;
  --spacing-unit: 1rem;
  --container-width: 800px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  padding: 2rem 1rem;
}

a {
  color: #4dabf7;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #74c0fc;
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1100px; /* Increased to accommodate sidebar */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  /* Hide scrollbar for cleaner look */
  scrollbar-width: none; 
}
.sidebar::-webkit-scrollbar { 
  display: none; 
}

/* Profile within Sidebar */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-img {
  width: 100%;
  max-width: 220px;
  height: 300px; /* Adjusted for sidebar ratio */
  border-radius: 100px;
  object-fit: cover;
  border: 4px solid var(--border);
  align-self: flex-start;
}

.profile-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.1;
}

.profile-role {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text-heading);
  transform: translateX(5px);
  text-decoration: none;
}

/* Main Content */
main {
  padding-top: 0;
  min-width: 0; /* Prevent grid blowout */
}

/* Responsive */
@media (max-width: 850px) {
  .container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
  }
  
  .profile-section {
    align-items: center;
    text-align: center;
  }

  .profile-img {
    align-self: center;
    max-width: 200px;
    height: 260px;
  }

  .contact-info {
    align-items: center;
  }

  .nav-menu {
    display: none;
  }
}

/* Sections */
section {
  margin-bottom: 3.5rem;
}

h2 {
  font-size: 1.5rem;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Items (Experience, Education) */
.item {
  margin-bottom: 2rem;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.item-subtitle {
  color: var(--text-primary);
}

.item-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--card-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.item-details {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

ul.details-list {
  list-style-type: none;
  padding-left: 0;
}

ul.details-list li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.3rem;
}

ul.details-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-secondary);
}

.location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* Publications Structured */
.publication-group {
  margin-bottom: 3rem;
}

.publication-group h3 {
  font-size: 1.1rem;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
  font-weight: 600;
  border-left: 3px solid var(--text-secondary);
  padding-left: 0.75rem;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pub-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 8px;
}

/* Interactive styles only for Journal and Conference */
.pub-item.type-journal,
.pub-item.type-conf {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.pub-item.type-journal:hover,
.pub-item.type-conf:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.pub-item.type-journal:hover .pub-title,
.pub-item.type-conf:hover .pub-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.pub-authors strong {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: #555;
  text-underline-offset: 3px;
}

.pub-venue {
  font-size: 0.9rem;
  color: #a5d8ff; /* Light blue for venue */
  font-style: italic;
}

.pub-note {
  font-size: 0.85rem;
  color: #ffc9c9; /* Light red/orange for notes/IF */
  font-weight: 500;
  display: inline-block;
}

.divider {
  border-top: 1px dashed var(--border);
  margin: 2rem 0;
}

/* Responsive */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  
  .contact-info {
    align-items: center;
  }
  
  .item-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-card);
  width: 90%;
  max-width: 850px;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.4;
  margin-right: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-heading);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  color: var(--text-primary);
  line-height: 1.7;
}

.modal-meta {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.modal-abstract {
  margin-bottom: 1.5rem;
}

.modal-abstract h4 {
  color: var(--text-heading);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.modal-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-heading);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.modal-link-btn:hover {
  background-color: var(--accent);
  text-decoration: none;
  color: #000;
}

/* --- Tabs --- */
.tabs-container {
  margin-top: 1rem;
}

.tabs-header {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--text-heading);
}

.tab-button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

#cfp-list {
    list-style: none;
    padding: 0;
}

#cfp-list li {
    padding: 0;
    border-bottom: none;
    margin-bottom: 2rem;
}

/* CFP Controls */
.cfp-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.cfp-select {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.cfp-toggle-btn {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cfp-toggle-btn:hover, .cfp-toggle-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-heading);
    border-color: var(--text-secondary);
}

/* CFP Card Item */
.pub-item.cfp-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem !important; /* Force padding to override reset */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pub-item.cfp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: #2c2e33;
}

/* Row 1: Header (Name, Cycle, D-Day) */
.pub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.conference-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4dabf7; /* Accent Blue */
    text-decoration: none;
}
.conference-name:hover {
    text-decoration: underline;
}

.conference-cycle {
    font-size: 1rem;
    color: var(--text-heading);
    margin-left: 0.5rem;
}

.d-day-badge {
    background-color: #e7f5ff;
    color: #1864ab;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.d-day-badge.urgent {
    background-color: #ffe3e3;
    color: #fa5252; /* Softer Red */
}

/* Row 2: Tags & Badges */
.pub-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tag-hashtag {
    color: #74c0fc; /* Soft Blue */
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.badge-bk21 {
    background-color: #1a1b1e;
    border: 1px solid #74c0fc;
    color: #74c0fc;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.badge-kiise {
    background-color: #1a1b1e;
    border: 1px solid #74c0fc;
    color: #74c0fc;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Row 3: Details (Deadline, Location) */
.pub-details-row {
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border);
}

.detail-label {
    font-weight: 600;
    color: var(--text-heading);
    margin-right: 0.5rem;
}

.detail-value {
    color: #ff922b; /* Orange for dates */
    font-weight: 500;
}

.detail-location {
    font-style: italic;
    color: var(--text-secondary);
}

/* Row 4: Keywords */
.pub-keywords-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.keyword-pill {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.1rem 0.6rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.03);
}


/* Dropdown Styles for DOMAIN Filter */
.cfp-dropdown-container {
    position: relative;
    display: inline-block;
}

.cfp-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background-color: #25262b;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    width: 300px;
    z-index: 1000;
    display: none;
    padding: 0.5rem;
}

.cfp-dropdown-menu.active {
    display: flex;
    flex-direction: column;
}

.cfp-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.cfp-logic-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.cfp-logic-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.cfp-logic-btn.active {
    background-color: var(--accent);
    color: white; /* Contrast text */
    border-color: var(--accent);
}

.cfp-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Custom Scrollbar for Dropdown */
.cfp-dropdown-list::-webkit-scrollbar {
    width: 8px;
}
.cfp-dropdown-list::-webkit-scrollbar-track {
    background: #1a1b1e; 
}
.cfp-dropdown-list::-webkit-scrollbar-thumb {
    background: #373a40; 
    border-radius: 4px;
}
.cfp-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #5c5f66; 
}

/* --- New CFP Domain Filter Styles (Tag Cloud) --- */

.cfp-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Override original controls margin because wrapper handles it */
.cfp-controls {
    margin-bottom: 0 !important; 
}

.cfp-filter-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.cfp-logic-toggle {
    display: flex;
    background-color: #1a1b1e;
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.logic-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logic-btn.active {
    background-color: var(--accent);
    color: #1a1b1e; /* Dark text on light accent */
    /* font-weight: 600; removed to prevent jitter */
}

.filter-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cfp-filter-pill {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cfp-filter-pill:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.cfp-filter-pill.active {
    background-color: rgba(77, 171, 247, 0.15); /* Soft Blue Tint */
    border-color: #74c0fc;
    color: #74c0fc;
    /* font-weight: 600; removed to prevent jitter */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
