/* =======================================================
   ExamVibe | Subcategory Page - Modern UI (v2)
   Professional, Responsive & Engaging
========================================================= */

:root {
  --primary: #007bff;
  --primary-dark: #0056b3;
  --gradient: linear-gradient(135deg, #007bff, #00c6ff);
  --radius: 14px;
  --font: 'Poppins', 'Inter', sans-serif;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  --bg: #f8fafc;
}

/* ===== Base Styles ===== */
body {
  font-family: var(--font);
  background: var(--bg);
  color: #1f1f1f;
  margin: 0;
  padding: 0;
}

/* ===== Container ===== */
.subcategory-container {
  max-width: 1200px;
  margin: 50px auto;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.subcategory-container::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: rgba(0, 123, 255, 0.08);
  border-radius: 50%;
}
.subcategory-container::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 180px;
  height: 180px;
  background: rgba(0, 123, 255, 0.05);
  border-radius: 50%;
}

/* ===== Heading ===== */
.subcategory-title {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  text-align: left;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInDown 1s ease;
}

.subcategory-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin-top: 8px;
  border-radius: 3px;
  animation: growLine 1.2s ease forwards;
}

/* ===== Description ===== */
.subcategory-desc {
  color: #444;
  font-size: 15px;
  line-height: 1.7;
  margin: 10px 0 25px;
  animation: fadeInUp 1.1s ease;
  text-align: justify;
}

/* ===== Grid Layout ===== */
.subcategory-grid {
  display: grid;
  gap: 18px;
  animation: fadeInUp 1s ease;
}

/* Responsive Columns */
@media (min-width: 576px) {
  .subcategory-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .subcategory-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .subcategory-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .subcategory-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== Subcategory Card ===== */
.subcategory-card {
  position: relative;
  background: #fff;
  padding: 20px 15px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid #eaeaea;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.35s ease;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
}
.subcategory-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.4s ease;
}
.subcategory-card:hover::before {
  opacity: 0.12;
}
.subcategory-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 22px rgba(0, 123, 255, 0.15);
  border-color: var(--primary);
}
.subcategory-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin: 0;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}
.subcategory-card:hover h3 {
  color: var(--primary-dark);
  transform: scale(1.07);
}

/* ===== Animations ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes growLine {
  from { width: 0; }
  to { width: 60px; }
}

/* ===== Hover Glow ===== */
.subcategory-card:hover::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  border-radius: 12px 12px 0 0;
  z-index: 3;
  animation: glowLine 0.6s ease;
}

@keyframes glowLine {
  from { width: 0; opacity: 0; }
  to { width: 100%; opacity: 1; }
}

/* ===== Mobile Optimization ===== */
@media (max-width: 576px) {
  .subcategory-container {
    margin: 20px;
    padding: 15px;
  }
  .subcategory-title {
    font-size: 22px;
  }
  .subcategory-card {
    padding: 15px;
  }
}
