/* ----- MODERN FONTS & BASE ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f4f7f9;
  color: #1a202c;
  line-height: 1.4;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.index-container { max-width: 1200px; width: 100%; margin: 0 auto; }

/* ----- HEADER ----- */
.page-header {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
  padding: 1.5rem 2.5rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
  border-bottom: 4px solid #6366f1;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%; z-index: 0;
}
.header-logo { width: 20%; display: flex; justify-content: flex-start; align-items: center; position: relative; z-index: 1; }
.header-logo img { max-width: 100%; max-height: 80px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05)); }
.header-gap { width: 5%; }
.header-text { width: 75%; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 1; }
.header-text h1 {
  font-family: 'Poppins', sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #4f46e5 0%, #ec4899 50%, #f59e0b 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent;
  letter-spacing: -0.5px; text-shadow: 2px 2px 10px rgba(236, 72, 153, 0.1);
}
.header-text .subhead { font-size: 1.05rem; color: #475569; font-weight: 500; letter-spacing: 0.5px; display: flex; align-items: center; gap: 0.75rem; }
.header-text .subhead::before { content: ''; display: inline-block; width: 30px; height: 3px; background: linear-gradient(90deg, #6366f1, #ec4899); border-radius: 2px; }

/* ----- SHARED GRID ----- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* ----- CATEGORY CARDS ----- */
.block-card {
  background: #ffffff; border-radius: 8px; padding: 1.2rem 0.75rem; text-align: center;
  text-decoration: none; color: #1a202c; transition: all 0.2s ease-in-out;
  border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.block-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1); }
.block-icon {
  font-size: 1.6rem; color: var(--accent); margin-bottom: 0.5rem;
  background: var(--accent-soft); width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.block-title { font-size: 0.95rem; font-weight: 700; color: #1a202c; margin-bottom: 0.15rem; }
.block-desc { font-size: 0.75rem; color: #4a5568; font-weight: 500; }

/* ----- SCHOOL CARDS (COMPACT HEIGHT) ----- */
.school-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.85rem 0.75rem;
  text-decoration: none;
  color: #1a202c;
  transition: all 0.2s ease-in-out;
  border: 2px solid #6366f1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.school-card:nth-child(4n+1) { border-color: #6366f1; }
.school-card:nth-child(4n+2) { border-color: #ec4899; }
.school-card:nth-child(4n+3) { border-color: #f59e0b; }
.school-card:nth-child(4n+4) { border-color: #10b981; }
.school-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08); }

.card-icon {
  font-size: 1rem;
  color: #6366f1;
  background: #e0e7ff;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
  margin-bottom: 0.4rem;
}
.school-card:nth-child(4n+1) .card-icon { color: #6366f1; background: #e0e7ff; }
.school-card:nth-child(4n+2) .card-icon { color: #ec4899; background: #fce7f3; }
.school-card:nth-child(4n+3) .card-icon { color: #f59e0b; background: #fef3c7; }
.school-card:nth-child(4n+4) .card-icon { color: #10b981; background: #d1fae5; }

.school-card h3 { font-size: 0.9rem; color: #1a202c; margin-bottom: 0.2rem; line-height: 1.2; }
.school-card .emis { font-size: 0.6rem; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
.school-card p { font-size: 0.7rem; color: #4a5568; margin-bottom: 0.1rem; display: flex; align-items: center; justify-content: center; gap: 0.3rem; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-card p i { color: #a0aec0; font-size: 0.65rem; }
.school-card .more { display: inline-block; margin-top: 0.6rem; font-size: 0.65rem; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: 0.5px; background: #e0e7ff; padding: 0.2rem 0.6rem; border-radius: 20px; }
.school-card:hover .more { background: #c7d2fe; }

/* ----- SEARCH BAR ----- */
.search-wrap { margin-bottom: 1.5rem; display: flex; justify-content: center; }
.search-bar { display: flex; width: 100%; max-width: 600px; background: #ffffff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #cbd5e0; }
.search-bar input { flex: 1; padding: 0.75rem 1.25rem; border: none; font-size: 0.95rem; font-family: inherit; outline: none; color: #1a202c; }
.search-bar button { background: #6366f1; color: #fff; border: none; padding: 0 1.5rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.search-bar button:hover { background: #4f46e5; }

.empty { text-align: center; padding: 3rem; background: #fff; border-radius: 12px; color: #4a5568; grid-column: 1 / -1; border: 1px solid #e2e8f0; }
.empty i { font-size: 2.5rem; color: #cbd5e0; margin-bottom: 1rem; display: block; }

/* ----- BACK BUTTON ----- */
.back-btn { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; text-decoration: none; color: #4a5568; font-weight: 600; font-size: 0.9rem; background: #fff; padding: 0.5rem 1rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); border: 1px solid #e2e8f0; align-self: flex-start; }
.back-btn:hover { color: #6366f1; border-color: #6366f1; }

/* ----- FOOTER ----- */
.page-footer { margin-top: auto; padding-top: 2rem; text-align: center; color: #4a5568; font-size: 0.85rem; display: flex; justify-content: space-between; width: 100%; flex-wrap: wrap; gap: 1rem; }
.admin-link { color: #4a5568; text-decoration: none; font-weight: 600; }
.admin-link:hover { color: #6366f1; }

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) { .grid-container { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .page-header { flex-direction: column; text-align: center; padding: 1.5rem 1rem; }
  .header-logo, .header-text { width: 100%; justify-content: center; }
  .header-logo { margin-bottom: 1.5rem; }
  .header-gap { display: none; }
  .header-text h1 { font-size: 1.9rem; }
  .header-text .subhead { justify-content: center; font-size: 0.95rem; }
  .header-text .subhead::before { display: none; }
}
@media (max-width: 600px) {
  .grid-container { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .page-footer { flex-direction: column; justify-content: center; text-align: center; }
}