:root {
  /* Primary Colors - Cosmic Sky */
  --cosmic-indigo: #1a1033;
  --midnight-blue: #0d1b2a;
  --star-gray: #b0b7c3;

  /* Accent Colors - Celestial Glow */
  --celestial-gold: #ffcc66;
  --mystic-purple: #9d4edd;
  --starlight-silver: #dbe9f4;
}

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

body {
  font-family: "Poppins", sans-serif;
  color: #fff;
  /* line-height: 1.6;
  min-height: 100vh; */
  /* position: relative; */
  overflow-x: hidden;
}

.token-warning {
  color: red !important;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #fff;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
/* sidbar title */
.chat-title {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* index */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.jyoti-loader #layer1,
.jyoti-loader #layer2,
.jyoti-loader #layer3,
.jyoti-loader #layer4,
.jyoti-loader #layer5,
.jyoti-loader #layer6 {
  position: absolute;
  background: transparent;
  border-radius: 50%;
  animation: spin infinite linear;
}

.jyoti-loader #layer1 {
  width: 50px;
  height: 50px;
  border: dashed 5px var(--celestial-gold);
  animation-duration: 2.5s;
  left: calc(50% - 25px);
  top: calc(50% - 25px);
}

.jyoti-loader #layer2 {
  width: 250px;
  height: 250px;
  border: dashed 5px var(--celestial-gold);
  opacity: 0.1;
  animation-duration: 3s;
  animation-direction: alternate;
  left: calc(50% - 125px);
  top: calc(50% - 125px);
}

.jyoti-loader #layer3 {
  width: 100px;
  height: 100px;
  border: outset 3px var(--mystic-purple);
  animation-duration: 2s;
  animation-direction: alternate-reverse;
  left: calc(50% - 50px);
  top: calc(50% - 50px);
}

.jyoti-loader #layer4 {
  width: 400px;
  height: 400px;
  border: inset 5px rgba(255, 255, 255, 0.05);
  animation-duration: 3.5s;
  left: calc(50% - 200px);
  top: calc(50% - 200px);
}

.jyoti-loader #layer5 {
  width: 150px;
  height: 150px;
  border: inset 2px var(--star-gray);
  border-style: dashed;
  animation-duration: 3.5s;
  animation-direction: reverse;
  left: calc(50% - 75px);
  top: calc(50% - 75px);
}

.jyoti-loader #layer6 {
  width: 300px;
  height: 300px;
  border: double 5px var(--celestial-gold);
  animation-duration: 2.5s;
  animation-direction: reverse;
  box-shadow: 0 0 8px var(--celestial-gold);
  left: calc(50% - 150px);
  top: calc(50% - 150px);
}
.desktop-loader {
  position: relative;
  height: 400px;
  margin-top: 3rem;
  z-index: 1;
}

.desktop-loader .jyoti-loader div {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.rightheroText {
  max-width: 100% !important;
}
.leftherobuttons a {
  margin-right: 1rem !important;
}

@media (max-width: 768px) {
  .desktop-loader {
    display: none;
  }

  .fullscreen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
  }

  .jyoti-loader div {
    transform: scale(0.7);
  }

  .right-content-mobile {
    position: relative;
    z-index: 2;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
  }
  .leftheroText {
    text-align: center !important;
  }
  .leftherobuttons {
    display: block !important;
    margin-right: 0% !important;
  }
}

/* loader */

.heroLogin {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  /* padding: 2rem 1rem; */
  justify-content: center;
  text-align: center;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(
    135deg,
    var(--midnight-blue),
    var(--cosmic-indigo)
  );
}

.noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.15"/%3E%3C/svg%3E');
  opacity: 0.3;
  z-index: -1;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.background,
.noise,
.gradient-overlay {
  pointer-events: none;
  user-select: none;
}
.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(57, 240, 217, 0.15),
      transparent 25%
    ),
    radial-gradient(circle at 80% 20%, rgba(255, 152, 0, 0.1), transparent 25%);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.loginbox {
  background: rgba(45, 48, 51, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 2.5rem;
  max-width: 550px;
  margin: 0 auto;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.8s ease-in;
}

.loginbox h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--star-gray);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(96, 125, 139, 0.3);
  border-radius: 4px;
  background: rgba(45, 48, 51, 0.3);
  color: #fff;
  font-family: "Poppins", sans-serif;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--celestial-gold);
  background: rgba(45, 48, 51, 0.5);
}

.btn-primary {
  background: rgba(57, 240, 217, 0.2);
  color: var(--celestial-gold);
  border: 1px solid rgba(57, 240, 217, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: rgba(57, 240, 217, 0.3) !important;
  box-shadow: 0 0 15px rgba(57, 240, 217, 0.3) !important;
  border: none;
}
.btn-primary:active {
  /* Active State - Deeper teal with amber accent */
  background: rgba(30, 200, 180, 0.4) !important;
  color: #ffffff !important;
  border-color: rgba(255, 152, 0, 0.5) !important;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 0 8px rgba(57, 240, 217, 0.6),
    0 0 12px rgba(255, 152, 0, 0.4) !important;
  transform: translateY(1px) !important;
}

.btn-primary:focus {
  /* Focus State - Strong glow */
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(57, 240, 217, 0.5),
    0 0 15px rgba(57, 240, 217, 0.4) !important;
  border-color: rgba(57, 240, 217, 0.5) !important;
  background: rgba(57, 240, 217, 0.3) !important;
}

/* Optional: Add a subtle pulse animation when active */
@keyframes pulseActive {
  0% {
    box-shadow: 0 0 5px rgba(57, 240, 217, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(57, 240, 217, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(57, 240, 217, 0.5);
  }
}

.btn-primary:active {
  animation: pulseActive 0.3s ease;
}
.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

a {
  color: var(--celestial-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #fff;
  text-decoration: underline;
}
.input-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
  font-size: 16px;
  opacity: 0.7;
  z-index: 10;
}

.toggle-password:hover {
  opacity: 1;
}

/* -----------------------------------------------------chat USer interface ----------------------------------- */

/* Sidebar style */
.sidebar {
  background: rgba(45, 48, 51, 0.5);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-history {
  overflow-y: auto;
  max-height: 65vh;
}

.chat-item {
  padding: 10px;
  cursor: pointer;
  transition: background 0.3s;
  border-radius: 6px;
}
.chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--celestial-gold);
}

/* Chat Area */
.chat-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  color: #fff;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
}
.chat-input {
  position: relative;
}
.chat-input textarea {
  padding-right: 55px;
}
.user-msg {
  background: rgba(57, 240, 217, 0.15);
  color: var(--celestial-gold);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  word-wrap: break-word;
  white-space: pre-wrap; /* Keep line breaks */
  max-width: 75%;
}
.ai-msg {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-wrap; /* Keep line breaks */
  max-width: 75%;
}
.input-row {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3); /* Darker base */
  /* box-shadow: 0 0 2px rgba(0, 255, 255, 0.4);   */
  border-radius: 8px;
  padding: 5px;
}
.input-row textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  resize: none;
  overflow-y: auto;
  line-height: 1.5em;
  padding: 10px;
  max-height: calc(1.5em * 5); /* Still limit to 5 lines */
  font-size: 14px;
}
.input-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.6); /* Softer white */
}
.input-row textarea:focus {
  box-shadow: none !important;
  color: var(--celestial-gold);
  background-color: transparent !important;
}
.input-row textarea:focus::placeholder {
  color: var(--celestial-gold);
  opacity: 0.6;
}
.input-row .send-btn {
  flex-shrink: 0;
  margin-left: 8px;
  background: var(--celestial-gold);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.input-row .send-btn:hover {
  box-shadow: 0 0 10px var(--celestial-gold);
}
textarea.autosize-limited {
  resize: none;
  overflow-y: auto;
  max-height: calc(1.5em * 5); /* Limit to 5 lines */
  line-height: 1.5em;
  padding: 0.75rem 1rem;
  transition: height 0.2s ease;
  word-wrap: break-word;
  white-space: pre-wrap;
}
/* Mobile toggle button */
.sidebar-toggle-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 10px;
  border-radius: 6px;
  z-index: 3001; /* Higher than sidebar */
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  cursor: pointer;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus,
.sidebar-toggle-btn:active {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.sidebar-toggle-btn .line {
  background: var(--celestial-gold);
  display: block;
  height: 3px;
  border-radius: 2px;
  opacity: 1;
  /* transform: rotate(-40deg); */
  transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  transform-origin: center;
}

/* Pulse per line when idle */
.sidebar-toggle-btn.idle .line1 {
  width: 22px;
  animation: pulseLine 2s infinite ease-in-out;
  animation-delay: 0s;
}
.sidebar-toggle-btn.idle .line2 {
  width: 16px;
  animation: pulseLine 2s infinite ease-in-out;
  animation-delay: 0.2s;
}
.sidebar-toggle-btn.idle .line3 {
  width: 10px;
  animation: pulseLine 2s infinite ease-in-out;
  animation-delay: 0.4s;
}

@keyframes pulseLine {
  0%,
  100% {
    transform: rotate(180deg) scaleX(1);
    opacity: 1;
  }
  50% {
    transform: rotate(180deg) scaleX(1.2);
    opacity: 0.8;
  }
}

/* Open Animation */
.sidebar-toggle-btn.animate .line1 {
  transform: translateY(10px) rotate(-50deg) scaleX(0.8);
  width: 22px;
  opacity: 0;
}
.sidebar-toggle-btn.animate .line2 {
  transform: translateY(7px) rotate(-50deg) scaleX(0.8);
  width: 16px;
  opacity: 0;
}
.sidebar-toggle-btn.animate .line3 {
  transform: translateY(4px) rotate(-50deg) scaleX(0.8);
  width: 10px;
  opacity: 0;
}

/* Close Animation (reverse) */
.sidebar-toggle-btn.reverse .line1 {
  transform: translateY(0) rotate(180deg);
  opacity: 1;
  width: 22px;
}
.sidebar-toggle-btn.reverse .line2 {
  transform: translateY(0) rotate(180deg);
  opacity: 1;
  width: 16px;
}
.sidebar-toggle-btn.reverse .line3 {
  transform: translateY(0) rotate(180deg);
  opacity: 1;
  width: 10px;
}

/* Mobile sidebar overlay effect */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    opacity: 0;
    width: 80%;
    height: 100%;
    background: rgba(45, 48, 51, 0.95);
    backdrop-filter: blur(10px);
    transition: transform 0.35s ease-in-out, opacity 0.35s ease-in-out;
    z-index: 2000;
    display: flex;
    flex-direction: column;
  }
  #sidebar.active {
    transform: translateX(0);
    opacity: 1;
  }

  .chat-area {
    width: 100%;
  }

  .chat-history {
    width: 100%;
  }
}

/* -----------------------------------------------------chat USer interface ----------------------------------- */

/* modal */
.custom-modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.custom-modal-content {
  position: relative;
  z-index: 10000;
  background: rgba(45, 48, 51, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  color: #fff;
  animation: slideFadeIn 0.3s ease-out;
}

.custom-modal-content h3 {
  margin-bottom: 1rem;
  color: var(--celestial-gold);
}

.custom-modal-content p {
  margin-bottom: 1.5rem;
  color: var(--star-gray);
}

.custom-modal .btn-primary {
  width: auto;
  padding: 0.5rem 1.5rem;
}
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-success {
  background-color: var(--celestial-gold);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.btn-success:hover {
  background-color: #00e0b8;
}
@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* end modal */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .loginbox {
    padding: 1.5rem;
  }
}
@media (max-width: 576px) {
  .loginbox h2 {
    font-size: 1.5rem;
  }

  .form-control {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.65rem;
    font-size: 0.95rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .loginbox {
    padding: 1.2rem;
    border-radius: 8px;
  }
}
