/* Custom Stylesheet for Kanchanjungha Education Centre (KEC) */

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

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

@keyframes pulse-slow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Custom Base Styles */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* STRIKING CONTRAST STYLES FOR PERFECT LEGIBILITY (FIXES UNREADABLE TEXTS) */

/* General Contrast rules without !important to avoid breaking white text elements */
body:not(.dark-mode) {
  background-color: #f8fafc;
  color: #1e293b;
}

body:not(.dark-mode) p:not(.text-white):not(.text-slate-300):not(.text-slate-200):not(.text-gray-300):not(.text-red-100) {
  color: #1e293b; /* Deep slate gray */
}

body:not(.dark-mode) h1:not(.text-white),
body:not(.dark-mode) h2:not(.text-white),
body:not(.dark-mode) h3:not(.text-white),
body:not(.dark-mode) h4:not(.text-white),
body:not(.dark-mode) h5:not(.text-white),
body:not(.dark-mode) h6:not(.text-white) {
  color: #0f172a; /* Solid dark jet black */
}

/* Dark Mode contrast */
.dark-mode {
  background-color: #0b0f19;
  color: #f8fafc;
}

.dark-mode p {
  color: #cbd5e1 !important;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
  color: #ffffff !important;
}

/* Exclude explicit overrides inside dark overlays */
.text-white {
  color: #ffffff !important;
}
.text-slate-100 {
  color: #f1f5f9 !important;
}
.text-slate-250 {
  color: #e2e8f0 !important;
}
.text-slate-300 {
  color: #cbd5e1 !important;
}
.text-gray-300 {
  color: #d1d5db !important;
}
.text-amber-400 {
  color: #fbbf24 !important;
}

/* Text Drop Shadow helper for Dark Banner backgrounds */
.text-shadow-md {
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc2626, #008080);
  width: 0%;
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* Glassmorphism CSS with higher opacity for legibility */
.glassmorphism {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(15, 23, 42, 0.1);
}

.dark-mode .glassmorphism {
  background: rgba(15, 23, 42, 0.98);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Glassmorphism Cards */
.glass-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Ripple Button Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* Typing Cursor */
.typing-cursor::after {
  content: '|';
  animation: blink 0.7s infinite;
}

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

/* Mega Menu Styles */
.mega-menu-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover .mega-menu-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Custom Utilities */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-pulse-slow {
  animation: pulse-slow 6s ease-in-out infinite;
}

/* Loading screen styling */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.dark-mode #loading-screen {
  background-color: #0b0f19;
}

/* Custom Lightbox for Gallery */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

/* FLOATING ACTIONS RESPONSIVENESS AND SPACING (PREVENTS OVERLAPPING) */
.floating-actions {
  position: fixed;
  bottom: 20px;
  left: 20px; /* Shift normal floating actions to the left-side to clear lower-right exclusively for the Chatbot */
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
}

@media (max-width: 640px) {
  .floating-actions {
    left: 12px;
    bottom: 12px;
    gap: 8px;
  }
}

/* AI CHATBOT SHIFTED TO THE EXCLUSIVE LOWER RIGHT SIDE */
#chatbot-container {
  font-family: 'Inter', sans-serif;
  position: fixed;
  bottom: 20px;
  right: 20px; /* Clean, default lower right side */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 1000;
  max-width: 95vw;
}

@media (max-width: 640px) {
  #chatbot-container {
    right: 12px;
    bottom: 12px;
  }
}

.chat-bubble-bot {
  background: #f1f5f9;
  color: #1e293b !important;
  border-bottom-left-radius: 2px;
}

.dark-mode .chat-bubble-bot {
  background: #1e293b;
  color: #f8fafc !important;
}

.chat-bubble-user {
  background: #c8102e;
  color: #ffffff !important;
  border-bottom-right-radius: 2px;
}

/* Suggestion Chips */
.suggestion-chip {
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  color: #1e293b !important;
  transition: all 0.2s ease;
  font-weight: 700 !important;
}

.suggestion-chip:hover {
  background-color: #c8102e;
  color: #ffffff !important;
  border-color: #c8102e;
}

.dark-mode .suggestion-chip {
  background-color: #1e293b;
  color: #f8fafc !important;
  border-color: #334155;
}

.dark-mode .suggestion-chip:hover {
  background-color: #c8102e;
  color: #ffffff !important;
  border-color: #c8102e;
}

/* Typing Indicator Dots Animation */
.typing-dots span {
  width: 6px;
  height: 6px;
  background-color: #64748b;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* SCROLLBAR HIDER */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
