/**
 * OhCampus — Listing Page Redesign (v1)
 * ---------------------------------------------------------------
 * CSS-only visual polish for the compiled Angular listing page
 * at /allCollegeList/*. Applied strictly on listing routes via
 * a body class set by listing-redesign.js.
 * -----------------------------------------------------------
 * NON-INVASIVE: overrides only, no layout structural changes.
 */

/* Activate scope only when body has the .ohc-listing-v1 class */
body.ohc-listing-v1 {
  /* Palette (aligned with OhCampus green + Shiksha-style neutrals) */
  --ohc-primary: #16b46a;
  --ohc-primary-dark: #0d8f52;
  --ohc-accent:  #2560f5;
  --ohc-warning: #f39c12;
  --ohc-danger:  #e74c3c;
  --ohc-ink:     #1e293b;
  --ohc-muted:   #64748b;
  --ohc-line:    #e5e7eb;
  --ohc-surface: #ffffff;
  --ohc-bg-soft: #f8fafc;
}

/* --------- Card container polish ---------- */
body.ohc-listing-v1 fuse-card.filter-listing {
  border: 1px solid var(--ohc-line);
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
  background: var(--ohc-surface);
  padding: 20px !important;
}
body.ohc-listing-v1 fuse-card.filter-listing:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(22, 180, 106, 0.35);
}

/* Accent left border on hover */
body.ohc-listing-v1 fuse-card.filter-listing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ohc-primary) 0%, var(--ohc-accent) 100%);
  opacity: 0;
  transition: opacity .2s ease;
}
body.ohc-listing-v1 fuse-card.filter-listing:hover::before {
  opacity: 1;
}

/* --------- Card image (thumbnail) ---------- */
body.ohc-listing-v1 fuse-card.filter-listing img {
  border-radius: 12px !important;
  object-fit: cover;
  transition: transform .3s ease;
}
body.ohc-listing-v1 fuse-card.filter-listing:hover img {
  transform: scale(1.03);
}

/* --------- Title styling ---------- */
body.ohc-listing-v1 fuse-card.filter-listing h1,
body.ohc-listing-v1 fuse-card.filter-listing h2,
body.ohc-listing-v1 fuse-card.filter-listing h3,
body.ohc-listing-v1 fuse-card.filter-listing h4,
body.ohc-listing-v1 fuse-card.filter-listing h5,
body.ohc-listing-v1 fuse-card.filter-listing div.text-lg.font-semibold {
  color: var(--ohc-ink) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.25;
  transition: color .18s ease;
  font-size: 16.5px !important;
}
body.ohc-listing-v1 fuse-card.filter-listing:hover div.text-lg.font-semibold {
  color: var(--ohc-primary-dark) !important;
}

/* --------- Injected badge strip ---------- */
.ohc-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px 0;
}
.ohc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.ohc-badge i { font-size: 10px; }

.ohc-badge--nirf     { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ohc-badge--naac     { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.ohc-badge--aicte    { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.ohc-badge--ugc      { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.ohc-badge--nba      { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ohc-badge--auto     { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.ohc-badge--verified { background: linear-gradient(135deg, #16b46a, #0d8f52); color: #fff; border-color: transparent; }
.ohc-badge--sponsored{ background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-color: transparent; }
.ohc-badge--scholarship { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

/* --------- Injected quick-stats chips (Estd | Location | Type) ---------- */
.ohc-quickstats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ohc-muted);
  margin: 4px 0 10px 0;
}
.ohc-quickstats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ohc-quickstats i {
  color: var(--ohc-primary);
  font-size: 12px;
}

/* --------- Injected action-row (Compare / Save / Share) ---------- */
.ohc-actionrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ohc-line);
}
.ohc-actionrow .ohc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ohc-line);
  background: var(--ohc-surface);
  color: var(--ohc-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none !important;
}
.ohc-actionrow .ohc-action-btn:hover {
  border-color: var(--ohc-primary);
  color: var(--ohc-primary-dark);
  background: #f0fdf4;
  transform: translateY(-1px);
}
.ohc-actionrow .ohc-action-btn.ohc-active {
  background: var(--ohc-primary);
  color: #fff !important;
  border-color: var(--ohc-primary);
}
.ohc-actionrow .ohc-action-btn i {
  font-size: 11px;
}

/* --------- Existing links row (Admissions | Courses & Fees | ...) ---------- */
body.ohc-listing-v1 fuse-card.filter-listing a[href*="/collegedetails/"],
body.ohc-listing-v1 fuse-card.filter-listing a[href*="/college/"] {
  color: var(--ohc-accent);
  font-weight: 500;
  transition: color .12s ease;
}
body.ohc-listing-v1 fuse-card.filter-listing a[href*="/collegedetails/"]:hover,
body.ohc-listing-v1 fuse-card.filter-listing a[href*="/college/"]:hover {
  color: var(--ohc-primary-dark);
  text-decoration: underline;
}

/* --------- CTA button uplift (Predict Admission / Brochure) ---------- */
body.ohc-listing-v1 fuse-card.filter-listing button.mat-flat-button {
  border-radius: 10px !important;
  font-weight: 600 !important;
  padding: 0 14px !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
body.ohc-listing-v1 fuse-card.filter-listing button.mat-flat-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(22, 180, 106, 0.22);
}

/* --------- Sidebar polish ---------- */
body.ohc-listing-v1 .p-3 > div[class*="Filters"],
body.ohc-listing-v1 [class*="filter-panel"] {
  border-radius: 14px !important;
}
body.ohc-listing-v1 [class*="Filter by"] {
  font-weight: 600 !important;
  color: var(--ohc-ink);
}

/* Highlight-strip cards (Scholarships / Predictor) already good — small tweak */
#ohc-listing-highlight-strip .ohc-hl-card {
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

/* --------- Sort dropdown + Search polish ---------- */
body.ohc-listing-v1 mat-form-field,
body.ohc-listing-v1 .mat-form-field {
  font-size: 14px;
}

/* --------- Loading skeleton (used when we know a card is arriving) ---------- */
.ohc-skeleton {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: ohc-shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes ohc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------- Result-count banner (injected by JS) ---------- */
#ohc-listing-resultcount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin: 0 0 14px 0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1px solid #d1fae5;
  border-radius: 12px;
  font-size: 13px;
  color: var(--ohc-ink);
}
#ohc-listing-resultcount .ohc-rc-count {
  font-weight: 700;
  color: var(--ohc-primary-dark);
}
#ohc-listing-resultcount .ohc-rc-hint {
  color: var(--ohc-muted);
  font-size: 12px;
}

/* --------- Mobile tuning ---------- */
@media (max-width: 767px) {
  body.ohc-listing-v1 fuse-card.filter-listing { padding: 14px !important; }
  .ohc-badge-row { gap: 4px; }
  .ohc-badge { font-size: 10.5px; padding: 2px 6px; }
  .ohc-quickstats { gap: 10px; font-size: 12px; }
  .ohc-actionrow .ohc-action-btn { padding: 5px 9px; font-size: 11.5px; }
}
