/* ============================================
   SUBJECT SELECTION PAGE STYLES
   ============================================ */

.subject-selection-main {
  padding: var(--space-8) 0 var(--space-16);
  min-height: calc(100vh - var(--navbar-height));
  background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: var(--space-12);
  animation: fadeInUp 0.6s ease-out;
}

.header-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-bold);
  color: var(--gray-900);
  margin-bottom: var(--space-3);
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Subjects Grid */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

/* Subject Card */
.subject-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.subject-card.fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.subject-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(102, 126, 234, 0.18);
  border: 2px solid #667eea;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  transition: height 0.3s ease;
}

.subject-card:hover::before {
  height: 5px;
  opacity: 1;
}

/* Subject Icon */
.subject-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
  transition: all 0.3s ease;
}

.subject-card:hover .subject-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Subject Icon Colors */
.subject-icon-blue {
  background: linear-gradient(135deg, #667eea15, #764ba215);
}

.subject-icon-orange {
  background: linear-gradient(135deg, #fa709a15, #fee14015);
}

.subject-icon-green {
  background: linear-gradient(135deg, #43e97b15, #38f9d715);
}

.subject-icon-purple {
  background: linear-gradient(135deg, #a8edea15, #fed6e315);
}

.subject-icon-teal {
  background: linear-gradient(135deg, #30cfd015, #33086715);
}

.subject-icon-indigo {
  background: linear-gradient(135deg, #4facfe15, #00f2fe15);
}

/* Subject Content */
.subject-content {
  position: relative;
  z-index: 1;
}

.subject-name {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.subject-description {
  font-size: var(--text-base);
  color: var(--gray-600);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.subject-meta {
  margin-bottom: var(--space-4);
}

.lesson-count {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-700);
}

/* Subject Action */
.subject-action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--primary-blue);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.action-arrow {
  transition: transform 0.3s ease;
}

.subject-card:hover .action-arrow {
  transform: translateX(5px);
}

/* Available Badge */
.available-badge {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  box-shadow: 0 4px 10px rgba(67, 233, 123, 0.3);
}

/* Disabled Subject Card */
.subject-card-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subject-card-disabled:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.subject-card-disabled .subject-icon {
  filter: grayscale(1);
}

.subject-card-disabled:hover .subject-icon {
  transform: none;
}

.subject-badge {
  margin-top: var(--space-3);
}

.badge-coming-soon {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--gray-200);
  color: var(--gray-600);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* Info Section */
.info-section {
  margin-top: var(--space-12);
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-8);
  background: linear-gradient(135deg, #667eea10, #764ba210);
  border-radius: var(--radius-xl);
  border: 2px solid #667eea20;
}

.info-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.info-content {
  flex: 1;
}

.info-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.info-text {
  font-size: var(--text-base);
  color: var(--gray-700);
  line-height: 1.7;
  margin: 0;
}

/* Loading Container */
.loading-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  gap: var(--space-4);
}

.loading-container p {
  color: var(--gray-600);
  font-size: var(--text-lg);
}

/* Error Message */
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16);
  color: var(--gray-600);
}

.error-message p:first-child {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

/* Footer Simple */
.footer-simple {
  background: var(--gray-900);
  color: var(--white);
  padding: var(--space-6) 0;
  text-align: center;
  font-size: var(--text-sm);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar-container {
  display: flex;
  align-items: center;
}

.navbar-logo {
  margin-right: auto; /* pushes menu to the right */
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px; /* controls space between Home and EN-த */
}

.navbar-logo {
  display: flex;
  gap: 8px;
  text-decoration: none;
  color: #000;
}

/* 🔧 Fine-tune vertical position */
.logo-icon {
  font-size: 22px;
  line-height: 1;
  transform: translateY(4px);  /* 👈 THIS moves it down */
}

/* Text block */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo-text span {
  font-weight: 600;
}

/* Hidden State */
.hidden {
  display: none !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* ============================================
   SUBJECT CARD WRAPPER
   Wraps card + subdivision panel together
   ============================================ */

.subject-card-wrapper {
  display: flex;
  flex-direction: column;
}

/* ============================================
   SUBDIVISION PANEL
   Slides open below the social science card
   ============================================ */

.subdivision-panel {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 0 var(--space-6);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    padding 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.subdivision-panel.open {
  max-height: 300px;
  opacity: 1;
  padding: var(--space-4) var(--space-6) var(--space-6);
}

/* Flatten bottom corners of card when panel is open */
.subject-card-wrapper:has(.subdivision-panel.open) .subject-card {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ============================================
   SUBDIVISION LOADING STATE
   ============================================ */

.subdivision-loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--gray-500);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
}

/* ============================================
   SUBDIVISION HEADER TEXT
   ============================================ */

.subdivision-header {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-3);
}

/* ============================================
   CHIPS ROW
   ============================================ */

.subdivision-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ============================================
   INDIVIDUAL CHIP
   ============================================ */

.subdivision-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--chip-bg);
  border: 2px solid var(--chip-border);
  border-radius: var(--radius-full);
  color: var(--chip-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.subdivision-chip:hover {
  background: var(--chip-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chip-icon {
  font-size: 1rem;
  line-height: 1;
}

.chip-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.chip-arrow {
  font-size: 0.8rem;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.subdivision-chip:hover .chip-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* ============================================
   EMPTY / ERROR STATE
   ============================================ */

.subdivision-empty {
  font-size: var(--text-sm);
  color: var(--gray-500);
  font-style: italic;
  margin: 0;
  padding: var(--space-1) 0;
}
/* ── Subject cards: per-subject accent border on hover ── */
.subject-card { border: 2px solid transparent; }

.subject-card[data-subject="english"]:hover     { border-color: #2563eb; box-shadow: 0 16px 40px rgba(37,99,235,0.15); }
.subject-card[data-subject="tamil"]:hover       { border-color: #f59e0b; box-shadow: 0 16px 40px rgba(245,158,11,0.15); }
.subject-card[data-subject="social-science"]:hover { border-color: #14b8a6; box-shadow: 0 16px 40px rgba(20,184,166,0.15); }
.subject-card[data-subject="mathematics"]:hover { border-color: #10b981; box-shadow: 0 16px 40px rgba(16,185,129,0.15); }
.subject-card[data-subject="science"]:hover     { border-color: #8b5cf6; box-shadow: 0 16px 40px rgba(139,92,246,0.15); }