/* ================================================================
   iHub Anubhuti — IIITD Foundation
   cps.css | Dedicated CPS Fellows & Table Page Stylesheet
   ================================================================ */

.cps-section {
  padding: 5rem 0 7rem 0;
  background: radial-gradient(circle at 50% 0%, #f7fafc 0%, #ffffff 80%);
  position: relative;
  overflow: hidden;
}

/* ── Dashboard Filter Controls ── */
.cps-dashboard-header {
  margin-bottom: 3.5rem;
}

.cps-filter-bar {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 82, 150, 0.08);
  border-radius: 24px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(14, 40, 73, 0.03);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Top Row: Search & Select Dropdowns */
.cps-filter-inputs {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr;
  gap: 1.25rem;
}

.cps-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cps-search-wrapper i {
  position: absolute;
  left: 1.25rem;
  color: var(--grey-500);
  font-size: 1rem;
}

.cps-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border: 1px solid rgba(28, 82, 150, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.cps-search-input:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 4px rgba(46, 126, 255, 0.12);
  background: #ffffff;
}

.cps-select-wrapper {
  position: relative;
}

.cps-select-input {
  width: 100%;
  padding: 0.85rem 2rem 0.85rem 1rem;
  border: 1px solid rgba(28, 82, 150, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--navy);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.cps-select-input:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 4px rgba(46, 126, 255, 0.12);
  background: #ffffff;
}

.cps-select-wrapper::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--grey-500);
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Bottom Row: Tabbed Year Navigation & Stats */
.cps-filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(28, 82, 150, 0.08);
  padding-top: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.cps-year-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(14, 40, 73, 0.04);
  padding: 0.35rem;
  border-radius: 12px;
}

.cps-tab-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey-700);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.cps-tab-btn:hover {
  color: var(--navy);
}

.cps-tab-btn.active {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 4px 10px rgba(14, 40, 73, 0.06);
}

.cps-stats-badge {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-light);
  background: rgba(46, 126, 255, 0.08);
  padding: 0.45rem 1rem;
  border-radius: 100px;
}

/* ── Premium Tables (Copied & Adapted from Fellowships page) ── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden; /* Prevent double scrollbars */
  border: 1px solid rgba(28, 82, 150, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(14, 40, 73, 0.02);
  background: #ffffff;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
  height: auto;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.premium-table th {
  background: var(--navy, #0E2849);
  color: var(--white);
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--gold, #FFC400);
  height: 54px;
  box-sizing: border-box;
}

.premium-table td {
  padding: 0.95rem 1.5rem;
  color: var(--grey-700, #5A6070);
  border-bottom: 1px solid rgba(28, 82, 150, 0.06);
  vertical-align: middle;
  line-height: 1.55;
  font-family: var(--font-body);
  height: 54px;
  box-sizing: border-box;
}

.premium-table tbody tr:last-child td {
  border-bottom: none;
}

.premium-table tbody tr {
  transition: background-color 150ms ease;
  animation: tableRowFadeIn 0.35s ease-out both;
}

@keyframes tableRowFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.premium-table tbody tr:nth-child(even) {
  background-color: rgba(28, 82, 150, 0.01);
}

.premium-table tbody tr:hover {
  background-color: rgba(230, 242, 255, 0.65);
}

.premium-table td strong {
  color: var(--navy);
  font-weight: 700;
}

/* ── Badges inside Table ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge--success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge--danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge--info {
  background-color: rgba(62, 139, 255, 0.1);
  color: #2e7eff;
  border: 1px solid rgba(62, 139, 255, 0.2);
}

.badge--warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge--secondary {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-year {
  background-color: rgba(14, 40, 73, 0.06);
  color: var(--navy-light);
  border: 1px solid rgba(14, 40, 73, 0.12);
  font-weight: 800;
}

/* ── Empty State ── */
.cps-no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cps-no-results i {
  font-size: 2.75rem;
  color: var(--grey-400);
  margin-bottom: 1rem;
}

.cps-no-results h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.cps-no-results p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--grey-600);
}

/* ── Responsive Adaptations ── */
@media (max-width: 991px) {
  .cps-filter-inputs {
    grid-template-columns: 1fr 1fr;
  }
  .cps-search-wrapper {
    grid-column: span 2;
  }
}

@media (max-width: 767px) {
  .cps-filter-inputs {
    grid-template-columns: 1fr;
  }
  .cps-search-wrapper {
    grid-column: span 1;
  }
  .cps-filter-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .cps-year-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ── Pagination Controls ── */
.cps-pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.cps-page-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(28, 82, 150, 0.12);
  background: #ffffff;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 10px rgba(14, 40, 73, 0.03);
}

.cps-page-btn:hover:not(:disabled) {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
  box-shadow: 0 6px 15px rgba(14, 40, 73, 0.12);
  transform: translateY(-2px);
}

.cps-page-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
  box-shadow: 0 6px 15px rgba(14, 40, 73, 0.12);
}

.cps-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Custom Hero Styles for CPS ── */
.init-hero--cps {
  position: relative;
  background: #04101e !important;
  overflow: hidden;
  border-bottom: none !important;
}

.init-hero--cps::after {
  content: '';
  position: absolute;
  inset: 0;
  /* background: linear-gradient(90deg, rgba(4, 16, 30, 0.35) 0%, rgba(4, 16, 30, 0.01) 60%, rgba(4, 16, 30, 0.01) 100%); */
  z-index: 1;
  pointer-events: none;
}

.init-hero--cps .hero-image-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  opacity: 0.9; /* Increased from 0.8 to make background image brighter */
  pointer-events: none;
}

.hero-inner-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 4.5rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-content-side {
  display: flex;
  flex-direction: column;
}

.init-hero--cps .init-hero-title {
  font-size: clamp(2.5rem, 5.5vw, 3.5rem) !important;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem !important;
}

.init-hero--cps .init-hero-desc {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  line-height: 1.6;
}

.hero-stats-side {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Redesigned Typewriter Terminal Stats Widget */
.stats-minimalist-typewriter {
  font-family: var(--font-display, 'Space Grotesk', monospace);
  background: rgba(4, 16, 30, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 290px;
  text-align: left;
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.typewriter-prefix {
  color: var(--gold);
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.65rem;
}

.typewriter-text {
  font-size: 1.35rem;
  font-weight: 700;
  display: inline;
  margin: 0;
  color: #ffffff;
  line-height: 1.3;
}

.typewriter-cursor {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  animation: blinkCursor 0.8s infinite;
  margin-left: 2px;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Core Research Focus Redesign ── */
.cps-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .cps-focus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cps-focus-grid {
    grid-template-columns: 1fr;
  }
}

.cps-focus-card {
  background: #ffffff;
  border: 1px solid rgba(28, 82, 150, 0.08);
  border-radius: 20px;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 10px 30px rgba(14, 40, 73, 0.02);
  display: flex;
  flex-direction: column; /* Vertical alignment (icon on top) */
  gap: 1.25rem;
  align-items: flex-start;
}

.cps-focus-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-light) 0%, var(--gold) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cps-focus-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(14, 40, 73, 0.08);
  border-color: rgba(28, 82, 150, 0.15);
}

.cps-focus-card:hover::before {
  opacity: 1;
}

.cps-focus-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(14, 40, 73, 0.04);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  flex-shrink: 0; /* Prevent icon container from shrinking */
}

.cps-focus-card:hover .cps-focus-icon-wrap {
  background: var(--navy);
  color: #ffffff;
  transform: translateY(-2px) rotate(5deg);
}

.cps-focus-content {
  flex-grow: 1;
}

.cps-focus-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.65rem;
  margin-top: 0.15rem;
}

.cps-focus-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--grey-600);
  line-height: 1.6;
}

@media (max-width: 480px) {
  .cps-focus-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem;
  }
}

/* Responsive Adaptations for Hero inner-grid */
@media (max-width: 991px) {
  .hero-inner-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .init-hero-title {
    margin-bottom: 1rem;
  }
  .init-hero-desc {
    margin: 0 auto;
  }
}

/* ── Core Research Focus Section Background ── */
.init-section--cps-focus {
  position: relative;
  padding: 5.5rem 0 !important;
}

.init-section--cps-focus .container {
  max-width: 1400px; /* Make it wider */
}

.init-section--cps-focus .init-section-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem) !important;
}

.init-section--cps-focus .init-section-desc {
  font-size: 1.25rem !important;
}


/* =================================================================
   CPS Research Page IHFC Overlay & Text Styling
   ================================================================= */
.init-hero--cps {
  background-color: #0c0f1d !important;
  min-height: 480px !important;
  padding-block: 150px 80px !important;
}

/* Left-fading dark gradient overlay: matches Media Coverage page hero */
.init-hero--cps::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(90deg, rgba(12, 15, 29, 0.5) 0%, rgba(12, 15, 29, 0.3) 40%, rgba(12, 15, 29, 0.05) 80%, transparent 100%) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.init-hero--cps .hero-image-bg {
  position: absolute !important;
  inset: 0 !important;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: scroll !important;
  opacity: 1 !important;
  filter: saturate(1.1) brightness(1.5) !important; /* Boosted brightness to match Careers page */
  pointer-events: none !important;
}

/* Typography Overrides: White title and glowing gold accent word */
.init-hero--cps .init-hero-title {
  color: var(--white) !important;
  font-size: clamp(2rem, 5vw, 3.25rem) !important;
  line-height: 1.25 !important;
  margin-bottom: var(--space-4) !important;
  text-shadow: 0 2px 10px rgba(12, 15, 29, 0.45) !important;
  z-index: 2;
  position: relative;
}

.init-hero--cps .init-hero-title span {
  font-style: normal !important;
  background: linear-gradient(135deg, #ffd54f 0%, #ffa000 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-shadow: none !important;
  padding-bottom: 0.12em !important;
  margin-bottom: -0.12em !important;
  display: inline-block;
}

.init-hero--cps .init-hero-desc {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: clamp(var(--text-base), 2.2vw, var(--text-md)) !important;
  line-height: 1.7 !important;
  font-weight: 500 !important;
  max-width: 780px !important;
  text-shadow: 0 2px 6px rgba(12, 15, 29, 0.8), 0 1px 2px rgba(12, 15, 29, 0.9) !important;
  z-index: 2;
  position: relative;
}
