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

/* ===== Page Base ===== */
.internship-page { font-family: 'Inter', sans-serif; color: #1a1a1a; }

/* ===== Hero ===== */
.hero {
  display: flex;
  align-items: stretch;
  min-height: 560px;
  overflow: visible;
  position: relative;
}
.hero-left {
  flex: 1;
  padding: 80px 120px 80px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  position: relative;
  z-index: 1;
}
.hero-left h1 {
  font-size: 38px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.hero-left p { color: #555; font-size: 17px; line-height: 1.7; margin-bottom: 36px; }
.btn-primary-il {
  background: #c41e2a;
  color: #fff;
  border: none;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  align-self: flex-start;
}
.btn-primary-il:hover { background: #a8111b; color: #fff; }
.hero-right {
  flex: 1;
  position: relative;
  /* background set via inline style in view using base_url() */
  overflow: visible;
}
.updates-card {
  position: absolute;
  left: -120px;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  height: 450px;
  background: #FEFEFA;
  border-radius: 0;
  padding: 36px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  z-index: 10;
}
.updates-card::-webkit-scrollbar { width: 4px; }
.updates-card::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.updates-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}
.updates-list {
  overflow-y: auto;
  height: 385px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  background: #FEFEFA;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.updates-list::-webkit-scrollbar { width: 4px; }
.updates-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.update-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13.5px;
  font-weight: 400;
  color: #1a1a1a;
  line-height: 1.55;
  background: #f2f2f2;
  cursor: pointer;
  text-decoration: none;
}
.update-item:last-child { border-bottom: none; }
.update-item-text {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 400;
}
.update-pin { font-size: 15px; flex-shrink: 0; margin-top: 2px; text-decoration: none; }

/* ===== Search ===== */
.search-section {
  width: 100%;
  padding: 20px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}
.search-section-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-section .search-bar {
  width: 220px;
}
.search-bar {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}
.search-bar input {
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  width: 220px;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.search-bar button {
  display: none;
}
.results-count { font-size: 14px; color: #333; font-weight: 500; }

/* ===== Main Layout ===== */
.il-main-content {
  width: 100%;
  padding: 0 60px 60px;
  box-sizing: border-box;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* ===== Sidebar Filters ===== */
.il-filters { width: 220px; flex-shrink: 0; }
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.filter-header h3 { font-size: 15px; font-weight: 600; }
.filter-header a { color: #c41e2a; font-size: 13px; text-decoration: none; }
.filter-group { margin-bottom: 8px; }
.filter-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px solid #e5e5e5;
  cursor: pointer;
}
.filter-group-title span { font-size: 14px; color: #555; }
.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #c41e2a;
  flex-shrink: 0;
}
.filter-option.active {
  border-left: 3px solid #c41e2a;
  padding-left: 8px;
  font-weight: 600;
}
.view-more {
  color: #c41e2a;
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* ===== Cards Area (wrapper for grid + pagination) ===== */
.il-cards-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Cards Grid ===== */
.il-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-content: start;
}
.il-card {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: box-shadow 0.2s ease;
}
.il-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.il-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
  padding-right: 55px;
}
.badge-new {
  position: absolute;
  right: 0;
  top: 24px;
  background: #1a6b3c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 16px 5px 14px;
  border-radius: 20px 0 0 20px;
  white-space: nowrap;
}
.il-card-institute {
  color: #c41e2a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.il-card-meta {
  color: #555;
  font-size: 12.5px;
  line-height: 1.7;
}
.il-card-fields {
  font-size: 12.5px;
  color: #333;
}
.il-card-fields a {
  color: #c41e2a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.more-fields-wrap {
  position: relative;
  display: inline-block;
}
.more-fields-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #1a1a1a;
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.more-fields-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 12px;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}
.more-fields-popover.hidden { display: none; }
.il-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #666;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.badge-active    { color: #1a6b3c; font-weight: 700; font-size: 13px; }
.il-badge-closed  { color: #c41e2a; font-weight: 700; font-size: 13px; }
.il-badge-closing { color: #e67e22; font-weight: 700; font-size: 13px; }
.il-badge-coming  { color: #6c757d; font-weight: 700; font-size: 13px; }

/* ===== Search loader ===== */
.il-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: il-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes il-spin {
  to { transform: rotate(360deg); }
}
#il-search-btn:disabled { opacity: 0.8; cursor: wait; }

/* ===== Mobile Filter Button (hidden on desktop) ===== */
.mobile-filter-btn { display: none; }
.search-section-left { display: contents; }
.filter-mobile-header { display: none; }

/* ===== Pagination ===== */
#ilPagination {
  display: flex;
  justify-content: center;
  padding: 60px 0 0;
}
.il-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.il-pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.il-pagination li a:hover { background: #f5f5f5; border-color: #bbb; }
.il-pagination li.active a { background: #c41e2a; color: #fff; border-color: #c41e2a; }
.il-pagination li.disabled a { color: #bbb; pointer-events: none; }
.il-pagination li.ellipsis {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
}

/* ===== Responsive ===== */

/* Tablet landscape (max 1200px) */
@media (max-width: 1200px) {
  .hero-left { padding: 60px 80px 60px 40px; }
  .hero-left h1 { font-size: 32px; }
  .updates-card { left: -80px; right: 40px; height: 420px; padding: 28px 24px; }
  .search-section { padding: 20px 40px; }
  .il-main-content { padding: 0 40px 60px; }
  .il-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait (max 992px) */
@media (max-width: 992px) {
  .hero { flex-direction: column; min-height: auto; }
  .hero-left { padding: 50px 40px; }
  .hero-left h1 { font-size: 28px; }
  .hero-left p { font-size: 15px; }
  .hero-right { min-height: 380px; width: 100%; }
  .updates-card {
    position: relative;
    left: auto; right: auto; top: auto;
    transform: none;
    width: calc(100% - 48px);
    margin: -60px auto 0;
    height: auto;
    max-height: 360px;
    z-index: 10;
  }
  .updates-list { height: 260px; }
  .search-section { padding: 20px 24px; }
  .il-main-content { padding: 20px 24px 40px; gap: 24px; }
  .il-filters { width: 200px; }
  .il-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
  /* Hero */
  .hero { flex-direction: column; min-height: auto; }
  .hero-left { padding: 40px 20px; text-align: left; align-items: flex-start; }
  .hero-left h1 { font-size: 26px; }
  .hero-left p { font-size: 15px; margin-bottom: 24px; }
  .btn-primary-il { width: 100%; text-align: center; padding: 14px 24px; }
  .hero-right { display: none; }

  /* Search */
  .search-section {
    padding: 14px 20px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .search-section-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
  }
  .mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: #1a1a1a;
  }
  .search-bar { flex: 1; }
  .search-bar input { width: 100%; flex: 1; }
  .results-count { display: none; }

  /* Main content */
  .il-main-content { padding: 16px 20px 40px; gap: 0; }
  .il-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: none;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    border: none;
    border-radius: 0;
  }
  .il-filters.open { display: flex; }
  .filter-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }
  .filter-mobile-header a { color: #c41e2a; font-size: 13px; text-decoration: none; }
  .filter-back-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #1a1a1a;
    padding: 0;
  }
  .filter-header { display: none; }
  .filter-group { padding: 0 20px; }
  .il-cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .il-card { padding: 18px; }
  .il-card-title { font-size: 15px; padding-right: 65px; }
  .badge-new { top: 18px; }
  #ilPagination { padding-top: 32px; }
}

/* Updates inline strip */
.updates-card-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.5;
}
.updates-card-inline strong {
  font-size: 13px;
  color: #c41e2a;
  white-space: nowrap;
}
.updates-card-inline a {
  color: #1a1a1a;
  text-decoration: underline;
}
.updates-card-inline a:hover { color: #c41e2a; }
.upd-sep { color: #bbb; }

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  .hero-left { padding: 32px 16px; }
  .hero-left h1 { font-size: 22px; }
  .hero-left p { font-size: 14px; }
  .search-section { padding: 12px 16px; }
  .il-main-content { padding: 12px 16px 32px; }
  .il-card { padding: 16px; gap: 10px; }
  .il-card-title { font-size: 14px; }
  .il-card-institute { font-size: 12px; }
  .il-card-meta { font-size: 11.5px; }
  .il-card-footer { font-size: 11.5px; }
  .filter-option { font-size: 12px; }
}
