:root {
    --color-light: #cadcfc;
    --color-mid: #8ab6f9;
    --color-dark: #00246b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-light);
  color: var(--color-dark);
  background: #000000;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: auto; /* allow content to determine height */
  overflow-y: hidden; /* enable scrolling */
}

/* Collapsed sidebar (default) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 80px;
  height: 100vh;
  background-color: var(--color-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  box-shadow: 2px 0 15px rgba(0,0,0,0.2);
  transition: width 0.35s ease;
  overflow: hidden;
  z-index: 99999;
}

.icon-btn {
  background: var(--color-mid);
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.icon-btn svg {
  flex-shrink: 0;
}
.icon-label {
  display: none;
  font-size: 0.95rem;
  color: #000000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Expanded state */
.sidebar.expanded {
  width: 340px;
  align-items: flex-start;
  padding: 20px;
}
.sidebar.expanded .icon-btn {
  justify-content: flex-start;
  width: 100%;
}
.sidebar.expanded .icon-label {
  display: inline;
  opacity: 1;
}
.sidebar.expanded .brand-name {
  display: none;
}

/* Toggle button style */
.toggle-btn {
  background: var(--color-dark);
  color: var(--color-light);
  font-weight: bold;
  font-size: 1.2rem;
  padding: 10px;
  transition: all 0.3s ease;
}
.toggle-btn:hover {
  color: var(--color-mid);
}
.toggle-symbol {
  font-family: monospace;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.8rem;
  color: var(--color-light);
  cursor: pointer;
  display: none; /* hidden by default */
  transition: color 0.3s ease;
}
.close-btn:hover {
  color: var(--color-mid);
}

/* Show close button only when expanded */
.sidebar.expanded .close-btn {
  display: block;
}


.sidebar-top, .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}



.logo {
    width: 50px;
    height: auto;
    transform: scale(1.8);
}

.icon-btn {
    background: var(--color-mid);
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.icon-btn:hover {
    background: var(--color-light);
    color: var(--color-dark);
}

.icon-btn svg {
    display: block;
}

.sidebar-middle {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
.brand-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.6rem;
    color: var(--color-mid);
    font-weight: 100;
    letter-spacing: 2px;
}

/* Profile Image */
.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--color-mid);
    object-fit: cover;
    cursor: pointer;
    transition: 0.3s ease;
}
.profile-img:hover {
    border-color: var(--color-light);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    background: var(--color-dark);
    padding: 10px 15px;
    margin: 0px;
    z-index: 99999;
    align-items: center;
    justify-content: space-between;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-header .icon-btn svg{
    width: 18px;
    height: 18px;
}

.mobile-logo {
    width: 40px;
    transform: scale(1.8);
}

/* ===== RESPONSIVE RULES ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    padding: 0;
    z-index: 999999 !important;
  }
  .sidebar.expanded {
    width: 320px;
    padding: 20px;
  }
    .mobile-header {
        display: flex; /* Show mobile header only on small screens */
    }
    main {
        padding: 0px;
    }
}

  main {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }


/* Fullscreen Matrix Canvas */
#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* Overlay (subtle glow/fade) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(0, 36, 107, 0.2) 0%,
    rgba(0, 0, 20, 0.9) 90%
  );
  z-index: -1;
  pointer-events: none;
}



#text-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  text-align: center;
  height: 100vh;
  pointer-events: none;
  display: block;
  z-index: 10;
}

/* Chat box */
.chat-input-container {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  z-index: 99999;
  max-width: 800px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);/* semi-transparent for blending */
  backdrop-filter: blur(12px);
  border: 1px solid #00246b;
  border-radius: 50px;
  padding: 30px 15px;
  gap: 10px;
}

.chat-input-container input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
}

.chat-input-container button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.3s ease, transform 0.2s ease;
}

.chat-input-container button svg {
  width: 22px;
  height: 22px;
  stroke: #00246b; /* Your branding red */
}

.chat-input-container button:hover {
    background: #00246b39;
  transform: scale(1.1);
}

.file-btn svg {
  stroke: #00ffcc; /* Accent for file upload */
}

.send-btn svg {
  stroke: #00246b; /* Main accent */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-input-container {
    padding: 25px 12px;
    margin-top: 0px;
    bottom: 130px;
    gap: 8px;
  }

  .chat-input-container input {
    font-size: 14px;
  }

  .chat-input-container button svg {
    width: 20px;
    height: 20px;
  }
}

/* Mobile Responsiveness */
@media (max-width: 468px) {
  .chat-input-container {
    padding: 20px 12px;
    margin-top: 0px;
    bottom: 120px;
    gap: 8px;
  }

  .chat-input-container input {
    font-size: 14px;
  }

  .chat-input-container button svg {
    width: 20px;
    height: 20px;
  }
}


.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4a90e2; /* default background for initials */
    color: white;
    font-weight: bold;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-transform: uppercase;
}
.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.ai-welcome-container {
    position: absolute;
    top: 20px;
    left: 10%;
    max-width: 300px;
    font-family: 'Exo 2', sans-serif;
    z-index: 10;
}

.ai-chat-bubble {
    background: rgba(0, 36, 107, 0.85);
    color: #cadcfc;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    font-size: 0.95rem;
    line-height: 1.4;
    border: 1px solid #8ab6f9;
    backdrop-filter: blur(6px);
}

.ai-welcome-container {
    transition: opacity 0.8s ease;
}


/* Mobile responsiveness */
@media (max-width: 768px) {
    .ai-welcome-container {
      top: 10px;
      left: 50%;
      transform: translateX(-50%);
      max-width: 90%;
      text-align: center;
    }
    .ai-chat-bubble {
      border-radius: 12px;
    }
}

/* Outer chat section (can hold other elements too) */
.chat-section {
  position: relative;
  display: flex;
  justify-content: center; /* Center chat horizontally */
  padding: 0px;
  width: 100%;
  height: auto; /* Can grow with content */
  z-index: 9999;
}
.chat-container {
  position: relative;
  max-width: 50vw;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #8ab6f9 transparent;
  overscroll-behavior: contain; /* Prevents body scroll interference */
  background: transparent;
}

/* Extra bottom padding so scrolling has breathing room */
.chat-container::after {
  content: "";
  display: block;
  height: 30px; /* space after last message */
}

/* ------------------ Chat Bubbles ------------------ */
.chat-bubble {
  position: relative;
  padding: 12px 16px;
  border-radius: 14px 14px 0 14px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

/* User Bubble */
.chat-bubble.user {
  align-self: flex-end;
  background: #8ab6f9;
  color: #00246b;
  border: 1px solid #00246b;
  border-radius: 14px 14px 14px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* AI Bubble */
.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(0, 36, 107, 0.8);
  color: #cadcfc;
  border: 1px solid #8ab6f9;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}

/* SCAN effect for AI */
.chat-bubble.scanning::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 200%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: scanMotion 2s linear infinite, glowPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.chat-bubble.scanning {
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 25px rgba(0, 255, 255, 0.3);
  border-color: rgba(0, 255, 255, 0.7);
}

/* Scan animation */
@keyframes scanMotion {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* Glow pulsing */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 25px rgba(0, 255, 255, 0.3); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.5); }
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 2px;
  background: #cadcfc;
  animation: blink-cursor 0.8s infinite;
  margin-left: 2px;
}

@keyframes blink-cursor {
  0%, 50%, 100% { opacity: 0; }
  25%, 75% { opacity: 1; }
}

/* Mobile view */
@media (max-width: 768px) {
  .chat-container {
    max-width: 100%;
  }
}


/* Wrapper for bubble + avatar */
.chat-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

/* Align user messages to the right */
.chat-wrapper.user {
  flex-direction: row-reverse;
}

/* Avatar next to bubble */
.chat-wrapper .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}



/* Hide modal by default */
#profile-modal {
  display: none; /* ensures it NEVER shows unless triggered */
}

.modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 36, 107, 0.5); /* brand navy overlay */
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, #00246b, #0a1b3d);
  border: 1px solid rgba(138, 182, 249, 0.5);
  border-radius: 6px;
  width: 90%;
  max-width: 400px;
  padding: 2rem;
  text-align: center;
  color: #cadcfc;
  box-shadow: 0 0 40px rgba(138, 182, 249, 0.4), 
              inset 0 0 25px rgba(202, 220, 252, 0.2);
  animation: zoomIn 0.3s ease;
  overflow: hidden;
  margin: auto;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(138,182,249,0.3) 1px, transparent 1px);
  background-size: 22px 22px;
  animation: particleFloat 18s linear infinite;
  z-index: 0;
}

@keyframes particleFloat {
  from { background-position: 0 0; }
  to { background-position: 120px 200px; }
}

/* Avatar */
.modal-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid #8ab6f9;
  box-shadow: 0 0 18px rgba(138,182,249,0.6);
}

/* Divider */
.divider {
  border: none;
  border-top: 3px solid rgba(202,220,252,0.25);
  margin: 1rem 0;
}

/* Close button */
.close-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #cadcfc;
  cursor: pointer;
}

/* Links */
.modal-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  margin-top: 0rem;
}

.modal-links a,
.modal-links button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  font-weight: 500;
  text-decoration: none;
  color: #cadcfc;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(138,182,249,0.4);
  backdrop-filter: blur(12px);
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
  cursor: pointer;
}

/* Glow border effect */
.modal-links a::before,
.modal-links button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;

  /* Gradient glow */
  background: linear-gradient(135deg, #cadcfc, #8ab6f9, #00246b);

  /* Mask to show only border area */
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; /* Chrome, Safari */
  
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;       /* Standard / Firefox / Edge */

  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;          /* ensure clickable underneath */
}

.modal-links a:hover,
.modal-links button:hover {
  background: rgba(138,182,249,0.08);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 15px rgba(138,182,249,0.35);
}

.modal-links a:hover::before,
.modal-links button:hover::before {
  opacity: 1;
}

/* Icon animation */
.modal-links a:hover svg,
.modal-links button:hover svg {
  transform: translateX(4px);
  color: #8ab6f9;
  filter: drop-shadow(0 0 6px #8ab6f9);
  transition: all 0.3s ease;
}

/* Logout button */
.logout-btn {
  background: linear-gradient(135deg, #8ab6f9, #00246b);
  color: #fff;
  padding: 0.6rem 1rem;
  margin-top: 0.8rem;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
  border: none;
  transition: 0.3s ease;
}
.logout-btn:hover {
  background: linear-gradient(135deg, #00246b, #8ab6f9);
  transform: translateX(4px);
}

#user-email {
  font-size: 0.9rem;
  color: #8ab6f9;
  margin: 0.3rem 0 0.8rem;
}

/* Footer */
.modal-footer {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #cadcfc;
  opacity: 0.7;
}

/* Animations */
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 600px) {
  .modal-content {
    padding: 1.5rem;
    border-radius: 15px;
  }
}

#page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Glassmorphism style */
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);

  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;

  /* Start off-screen above */
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

#page-transition.active {
  transform: translateY(0);
  opacity: 1;
}

#page-transition.fade-up {
  /* Slide up to hide */
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.logo-wrapper img {
  width: 340px;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.3s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }

}



/* Chat History Container */
.chat-history-list {
  margin-top: 0rem;
  max-height: 45vh;
  overflow-y: auto;
  display: none; /* Hidden by default until sidebar expands */
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 10px;
  transition: all 0.4s ease-in-out;

}

/* Scrollbar styling */
.chat-history-list::-webkit-scrollbar {
  width: 6px;
}
.chat-history-list::-webkit-scrollbar-thumb {
  background-color: #8ab6f9;
  border-radius: 10px;
}
.chat-history-list::-webkit-scrollbar-thumb:hover {
  background-color: #cadcfc;
}

/* Chat Item */
.chat-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(138, 182, 249, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #cadcfc;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  margin-left: -10px;
  justify-content: space-between;
  box-shadow: 0 0 6px rgba(0, 36, 107, 0.2);
}

/* Hover Effect */
.chat-item:hover {
  background: rgba(138, 182, 249, 0.15);
  border-color: #8ab6f9;
  transform: translateX(4px);
  box-shadow: 0 0 10px rgba(138, 182, 249, 0.3);
}

/* Active Chat Item */
.chat-item.active {
  background: linear-gradient(90deg, #00246b, #8ab6f9);
  color: #ffffff;
  font-weight: 600;
  border: none;
  box-shadow: 0 0 12px rgba(138, 182, 249, 0.5);
  transform: scale(1.03);
}

/* Glow pulse animation for active item */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(138, 182, 249, 0.6); }
  50% { box-shadow: 0 0 14px rgba(138, 182, 249, 1); }
}

.chat-item.active {
  animation: glowPulse 2s infinite ease-in-out;
}
/* ============================= */
/*   HISTORY MODAL STYLING       */
/* ============================= */

.history-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: rgba(5, 12, 28, 0.85); /* slightly translucent dark */
  backdrop-filter: blur(8px);
  display: none; /* hidden by default */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  z-index: 9999;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-in-out;
}

/* Desktop view (cover 30% width, centered) */
@media (min-width: 768px) {
  .history-modal {
    width: 30%;
    height: 100vh;
    right: 0;
    top: 0;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.4);
    background: rgba(5, 12, 28, 0.75);
    margin-left: auto;
  }
}

.history-modal.active {
  display: flex; /* show it when active */
}


/* Smooth fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================= */
/*   CLOSE BUTTON STYLING        */
/* ============================= */

.history-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  color: #cadcfc;
  font-size: 1.4rem;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-modal h2{
  color: #cadcfc;
}

.history-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* ============================= */
/*   HISTORY CONTENT LIST         */
/* ============================= */

.history-modal-content {
  width: 100%;
  max-width: 600px;
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
}

/* Each chat preview inside the modal */
.history-modal-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(138, 182, 249, 0.3);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  color: #cadcfc;
  margin-bottom: 5px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  box-shadow: 0 0 6px rgba(0, 36, 107, 0.25);
}

.history-modal-item:hover {
  background: rgba(138, 182, 249, 0.15);
  border-color: #8ab6f9;
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(138, 182, 249, 0.3);
}

.history-modal-item.active {
  background: linear-gradient(90deg, #00246b, #8ab6f9);
  color: white;
  font-weight: 600;
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(138, 182, 249, 0.5);
  animation: glowPulse 2s infinite ease-in-out;
}

/* Reuse the same glow animation but scoped */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(138, 182, 249, 0.6); }
  50% { box-shadow: 0 0 14px rgba(138, 182, 249, 1); }
}


/* Mode Switcher Container */
.mode-switcher {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  background: #00246b;
  border-bottom: 1px solid #8ab6f9;
  position: sticky;
  top: 0;
  z-index: 999;
}

/* Buttons */
.mode-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid #cadcfc;
  background: transparent;
  color: #cadcfc;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s ease;
}

.mode-btn:hover {
  background: #8ab6f9;
  color: #00246b;
}

/* Active Mode */
.mode-btn.active {
  background: #cadcfc;
  color: #00246b;
  font-weight: 600;
}

/* Mobile — move below header */
@media (max-width: 768px) {
  .mode-switcher {
    background: #00246b;
  }
}


/* ---------------------------- */
/* Detection UI Container */
/* ---------------------------- */
.detection-ui {
  width: 100%;
  max-width: 50vw; /* same as chat container */
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 4px; /* aligns with AI bubble slightly */
  margin-top: 8px;
  margin-bottom: 15px;
  font-family: 'Inter', sans-serif;
  z-index: 1; /* ensure it stays in flow */
  transition: opacity 0.3s ease;
}

/* Hidden class — only hide the element itself */
.detection-ui.hidden {
  display: none !important;
}

/* ---------------------------- */
/* Textarea */
/* ---------------------------- */
#detect-input {
  width: 100vw; /* full viewport width */
  max-width: 100%; /* prevents overflow */
  min-height: 120px;
  padding: 14px;
  font-size: 1rem;
  font-family: 'Exo 2', sans-serif;
  color: #cadcfc;
  background: rgba(0, 36, 107, 0.35);
  border: 1px solid #8ab6f9;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box; /* includes padding and border in width */
}


#detect-input:focus {
  border-color: #cadcfc;
  box-shadow: 0 0 8px rgba(202, 220, 252, 0.6);
}

/* ---------------------------- */
/* Run Detection Button */
/* ---------------------------- */
#run-detection-btn {
  padding: 12px 16px;
  border-radius: 4px;
  background: #8ab6f9;
  color: #00246b;
  border: none;
  margin-top: 10px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  align-self: flex-start; /* aligns nicely under textarea */
  transition: background 0.25s ease, transform 0.15s ease;
}

#run-detection-btn:hover {
  background: #cadcfc;
  transform: translateY(-1px);
}

#run-detection-btn:active {
  transform: translateY(1px);
}

/* ---------------------------- */
/* Detection Result Bubble */
/* ---------------------------- */
.chat-bubble.detect-result {
  align-self: flex-start;
  background: rgba(255, 198, 0, 0.1);
  border-left: 6px solid #ffeb3b;
  color: #ffeb3b;
  padding: 14px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 14px rgba(255, 235, 59, 0.4);
  margin-top: 8px;
  max-width: 100%;
  animation: fadeIn 0.3s ease-out;
}

/* ---------------------------- */
/* Reuse fadeIn for detection bubble */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------- */
/* Mobile Responsiveness */
/* ---------------------------- */
@media (max-width: 768px) {
  .detection-ui {
    max-width: 90%; /* full width on mobile */
  }
  
  #detect-input {
    min-height: 100px;
  }
}


.chat-bubble .copy-btn {
  float: right;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.chat-bubble .copy-btn:hover {
  opacity: 1;
}


.humanizer-ui {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.hidden {
  display: none ;
}


.humanizer-container {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, #111327, #161a35);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: 'Exo 2', sans-serif;
  color: #ececf4;
}

.humanizer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 8px;
}

.humanizer-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.humanizer-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.humanizer-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* =========================
   Input
========================= */
#humanize-input {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0e1024;
  color: #ececf4;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#humanize-input::placeholder {
  color: rgba(236, 236, 244, 0.38);
}

#humanize-input:focus {
  background: #10122a;
  border-color: rgba(123, 92, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(123, 92, 255, 0.22);
}

/* =========================
   Action Row
========================= */
.humanizer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

/* =========================
   Futuristic AI Button
========================= */
#run-humanizer-btn {
  position: relative;
  padding: 11px 26px;
  border-radius: 5px;
  border: none;
  background: linear-gradient(
    120deg,
    #6f63ff,
    #4a5cff,
    #8b7bff
  );
  background-size: 200% 200%;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 100;
  letter-spacing: 0.45px;
  isolation: isolate;

  box-shadow:
    0 0 0 1px rgba(123, 92, 255, 0.45),
    0 10px 30px rgba(74, 92, 255, 0.55),
    0 0 28px rgba(123, 92, 255, 0.35);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;

  animation: gradientShift 4s ease infinite;
}

/* Soft energy aura */
#run-humanizer-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
 
  background: linear-gradient(
    120deg,
    rgba(47, 0, 255, 0.6),
    rgba(99, 91, 255, 0.4),
    rgba(43, 0, 255, 0.6)
  );
  filter: blur(10px);
  opacity: 0.6;
  z-index: -1;
  transition: opacity 0.2s ease;
}

/* Holographic sheen */
#run-humanizer-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.05) 40%,
    rgba(255,255,255,0.0) 60%
  );
  opacity: 0.35;
  pointer-events: none;
}

/* Hover */
#run-humanizer-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 1px rgba(155, 135, 255, 0.6),
    0 16px 42px rgba(74, 92, 255, 0.7),
    0 0 42px rgba(123, 92, 255, 0.55);
}

#run-humanizer-btn:hover::before {
  opacity: 0.9;
}

/* Active / Press */
#run-humanizer-btn:active {
  transform: translateY(0);
  filter: brightness(1);
}

.chat-bubble.humanizer-ai {
  background: linear-gradient(135deg, #8a2be2, #5f00ff, #a64cff);
  color: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(90, 0, 255, 0.3);
}

.scroll-bottom-btn {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.905); /* futuristic blue */
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 12px;
  cursor: pointer;
  z-index: 1000;
  display: none;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.scroll-bottom-btn:hover {
  transform: translateX(-50%) scale(1.2);
  opacity: 0.95;
  background-color: rgba(0, 36, 107, 1);
}

/* SVG styling inside button */
.scroll-bottom-btn svg {
  display: block;
  stroke: #fff; /* arrow color */
}



.credits-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 36, 107, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.credits-modal.hidden {
  display: none;
}

.credits-card {
  background: #00246b;
  color: #cadcfc;
  max-width: 420px;
  width: 100%;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
  font-family: "Exo 2", "Inter", sans-serif;
  box-shadow: 0 0 40px rgba(138, 182, 249, 0.4);
}

.credits-card h2 {
  margin-bottom: 10px;
  font-size: 1.6rem;
}

.credits-card p {
  font-size: 0.95rem;
  opacity: 0.9;
}

.credits-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.pay-btn {
  background: linear-gradient(135deg, #cadcfc, #8ab6f9);
  color: #00246b;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: 1px solid #8ab6f9;
  color: #cadcfc;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
}
