/* ============================================
   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;
}

/* ============================================
   CHATBOT STYLES - IMPROVED MODERN DESIGN
   ============================================ */

/* Chat Float Container */
.chat-float-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.5rem;
}

/* Modern Chat Window */
.chat-window-modern {
  width: 420px;
  height: 680px;
  max-height: 85vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
              0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window-modern.hidden {
  display: none;
}

/* Chat Header */
.chat-header-modern {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  background: #3b82f6;
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  box-shadow: 0 0 12px #3b82f6;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.chat-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-title {
  color: white;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.chat-status {
  color: #60a5fa;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Chat Messages Area */
.chat-messages-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
}

/* Scrollbar Styling */
.chat-messages-area::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.chat-messages-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.chat-messages-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Message Bubbles */
.ai-msg {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  color: #e2e8f0;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-msg {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  padding: 14px 18px;
  border-radius: 18px 18px 4px 18px;
  color: white;
  align-self: flex-end;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Quick Actions Bar */
.quick-actions-bar {
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.5);
}

.quick-actions-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Chat Input Area */
.chat-input-area {
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input-field::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input-field:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Send Button */
.send-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border: none;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.send-btn:active {
  transform: translateY(0);
}

/* Chat Orb Trigger */
.chat-orb-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-orb-trigger:hover {
  transform: scale(1.05);
}

.chat-orb-trigger:active {
  transform: scale(0.95);
}

/* Kimi-Style Floating Orb */
.kimi-orb {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4), 
              inset 0 0 15px rgba(255, 255, 255, 0.2);
  animation: floatOrb 3s ease-in-out infinite;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Pulsing outer ring */
.kimi-orb::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  z-index: -1;
  animation: pulseRing 2s ease-out infinite;
}

/* Orb Face with Eyes */
.orb-face {
  display: flex;
  gap: 10px;
  align-items: center;
}

.eye {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  animation: blink 4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

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

@keyframes pulseRing {
  0% { 
    transform: scale(0.95); 
    opacity: 0.8; 
  }
  100% { 
    transform: scale(1.4); 
    opacity: 0; 
  }
}

@keyframes blink {
  0%, 90%, 100% { opacity: 1; }
  95% { opacity: 0; }
}

/* 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); }

