/* ==========================================================================
   Mountain Empire Tech - Design System & Custom Styles
   Theme: Fire & Slate (Ascent Tech Identity)
   ========================================================================== */

:root {
  --color-primary: #a63b00;
  --color-primary-container: #ff5e00;
  --color-primary-hover: #e05300;
  --color-primary-dark: #822e00;
  --color-secondary: #bc0100;
  --color-tertiary: #565e74;
  --color-tertiary-dark: #0b1c30;
  --color-inverse-surface: #213145;
  --color-background: #f8f9ff;
  --color-surface-dim: #eaf1ff;
  --color-surface-card: #ffffff;
  --color-outline: #8f7065;
  --color-outline-variant: #e4bfb1;
  --color-text-main: #0b1c30;
  --color-text-muted: #5b4137;
  --color-text-tertiary: #565e74;
  
  --gradient-primary: linear-gradient(135deg, #ff5e00 0%, #a63b00 100%);
  --gradient-primary-hover: linear-gradient(135deg, #ff701e 0%, #be4300 100%);
  --gradient-secondary: linear-gradient(135deg, #bc0100 0%, #ff5e00 100%);
  --gradient-dark: linear-gradient(135deg, #0b1c30 0%, #213145 100%);
  --gradient-card-glow: radial-gradient(circle at top right, rgba(255, 94, 0, 0.08) 0%, transparent 60%);

  --shadow-sm: 0 2px 8px rgba(11, 28, 48, 0.04);
  --shadow-md: 0 4px 20px rgba(11, 28, 48, 0.06);
  --shadow-lg: 0 10px 30px rgba(11, 28, 48, 0.1);
  --shadow-primary: 0 8px 24px rgba(255, 94, 0, 0.25);
  --shadow-hover: 0 14px 36px rgba(15, 23, 42, 0.12);
  
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;
  --radius-full: 9999px;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}
.material-symbols-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  font-family: 'Inter', sans-serif;
  color: var(--color-text-main);
  background-color: var(--color-background);
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Montserrat', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #eff4ff;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff5e00;
}

/* Custom Button Styles */
.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(255, 94, 0, 0.28);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 94, 0, 0.38);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary-container) !important;
  border: 1.5px solid var(--color-primary-container);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-secondary:hover {
  background: rgba(255, 94, 0, 0.08);
  transform: translateY(-2px);
}

.btn-dark {
  background: #0b1c30;
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-dark:hover {
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 28, 48, 0.25);
}

/* Card Glow and Hover Effects */
.empire-card {
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-xl);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.empire-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.empire-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 94, 0, 0.3);
}
.empire-card:hover::before {
  opacity: 1;
}

/* Glassmorphism */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.glass-panel-dark {
  background: rgba(11, 28, 48, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text */
.text-gradient-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-secondary {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hero Background Pattern */
.bg-grid-pattern {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
}
.bg-radial-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255, 94, 0, 0.12) 0%, transparent 65%);
}

/* Badge Styles */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-primary {
  background: rgba(255, 94, 0, 0.12);
  color: #a63b00;
  border: 1px solid rgba(255, 94, 0, 0.25);
}
.badge-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #ffb599;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation active states */
.nav-link {
  position: relative;
  transition: all 0.2s ease;
}
.nav-link.active {
  color: #ff5e00 !important;
  font-weight: 700;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #ff5e00;
  border-radius: 2px;
}

/* Mobile Drawer Animation */
#mobile-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
#mobile-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
#mobile-drawer.closed {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* Modal Overlay */
.modal-overlay {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Floating back to top button */
#back-to-top {
  position: fixed !important;
  bottom: 96px !important;
  right: 28px !important;
  z-index: 9990 !important;
  width: 46px !important;
  height: 46px !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
#back-to-top.show {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
#back-to-top.hide {
  transform: translateY(16px) scale(0.85) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Stats Counter Pulse */
.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.stat-box:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 94, 0, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

/* Interactive Timeline in About Us */
.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff5e00;
  border: 4px solid #0b1c30;
  position: absolute;
  top: 24px;
}

/* ==========================================================================
   Page Transitions & Scroll Animations
   ========================================================================== */

/* Reading Scroll Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff5e00, #ff8c00, #ff3b00);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.7);
  pointer-events: none;
}

/* Page Transition States */
body {
  opacity: 1;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.page-loaded {
  animation: pageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.page-leaving {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  pointer-events: none !important;
}

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Reveal (Slide Up & Down when scrolling) */
.reveal-init {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-init.reveal-slide-down {
  transform: translateY(-32px);
}

.reveal-init.reveal-slide-left {
  transform: translateX(36px);
}

.reveal-init.reveal-slide-right {
  transform: translateX(-36px);
}

.reveal-init.reveal-zoom {
  transform: scale(0.94);
}

.reveal-visible {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Stagger Delays for Grid Items */
.delay-100 { transition-delay: 100ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }
.delay-600 { transition-delay: 600ms !important; }

/* Click Ripple & Subject Press Animations */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 94, 0, 0.4) 0%, rgba(255, 94, 0, 0) 70%);
  transform: scale(0);
  animation: rippleAnimation 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 50;
}

@keyframes rippleAnimation {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

.subject-clickable, .empire-card, .btn-primary, .btn-secondary, .btn-dark, .stat-box {
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.subject-clickable:active, .empire-card:active {
  transform: scale(0.985);
}

/* Subject Selected Pulse Effect */
.subject-clicked-effect {
  animation: subjectPulse 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes subjectPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); box-shadow: 0 0 20px rgba(255, 94, 0, 0.4); }
  100% { transform: scale(1); }
}

/* Floating Elements & Parallax */
.floating-element {
  animation: floatUpDown 4s ease-in-out infinite alternate;
}

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

.floating-element-reverse {
  animation: floatDownUp 5s ease-in-out infinite alternate;
}

@keyframes floatDownUp {
  0% { transform: translateY(0px); }
  100% { transform: translateY(8px); }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}
.animate-pulse-glow {
  animation: pulseGlow 4s infinite ease-in-out;
}

/* ==========================================================================
   Mountain Empire Tech - AI Chatbot Widget Styles
   ========================================================================== */

#empire-chat-widget {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 9999 !important;
  font-family: 'Inter', sans-serif;
  pointer-events: auto !important;
}

/* Floating Chat Toggle Button */
#chat-toggle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5e00 0%, #a63b00 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(255, 94, 0, 0.45);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  position: relative;
  user-select: none;
}

#chat-toggle-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 30px rgba(255, 94, 0, 0.6);
}

#chat-toggle-btn:active {
  transform: scale(0.95);
}

#chat-toggle-btn .chat-btn-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Chat Window Container */
#chat-window {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(11, 28, 48, 0.25), 0 0 0 1px rgba(11, 28, 48, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
  z-index: 1000;
}

#chat-window.chat-closed {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

#chat-window.chat-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* Chat Header */
.chat-header {
  background: #0b1c30;
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Message Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8faff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Message Bubbles */
.chat-msg {
  max-width: 85%;
  font-size: 0.8125rem;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 2px 6px rgba(11, 28, 48, 0.04);
}

.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff5e00 0%, #e05300 100%);
  color: #ffffff;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 4px 12px rgba(255, 94, 0, 0.25);
}

/* Quick Topic Pills inside Chat */
.chat-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.chat-pill-btn {
  background: #eff4ff;
  border: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chat-pill-btn:hover {
  background: #ff5e00;
  border-color: #ff5e00;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Typing Indicator Animation */
.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.8rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  width: fit-content;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  background: #ff5e00;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Chat Input Bar */
.chat-input-bar {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-input-field {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.8125rem;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input-field:focus {
  background: #ffffff;
  border-color: #ff5e00;
  box-shadow: 0 0 0 2px rgba(255, 94, 0, 0.15);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  background: #ff5e00;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #e05300;
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

/* Mobile full-screen responsive adjustment */
@media (max-width: 480px) {
  #chat-window {
    width: calc(100vw - 20px);
    right: -10px;
    height: 480px;
    bottom: 70px;
  }
}
