@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

:root {
  --bg-light: #eef5ff;
  --card-bg-light: #ffffff;
  --text-light: #333;
  --header-bg-light: #3674ff;
  --user-msg-bg-light: #007bff;
  --bot-msg-bg-light: #e9e9eb;
  --input-bg-light: #f0f2f5;
  --accent-color: #a3e583;

  --bg-dark: #1c2230;
  --card-bg-dark: #2a3144;
  --text-dark: #e2e6f0;
  --header-bg-dark: #22376f;
  --user-msg-bg-dark: #3d6bba;
  --bot-msg-bg-dark: #353f57;
  --input-bg-dark: #202634;
}

body.dark-mode .chat-card {
  background: var(--card-bg-dark);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(50, 100, 200, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body {
  background: var(--bg-light);
  font-family: "Roboto", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  color: var(--text-light);
  transition: background 0.4s;
}

body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--card-bg-light);
  color: var(--text-light);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode .modal-content {
  background: var(--card-bg-dark);
  color: var(--text-dark);
}

.modal-content h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 15px;
}

.modal-content p {
  margin-bottom: 25px;
  line-height: 1.6;
  font-size: 16px;
}

.disclaimer-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  font-size: 16px;
}

.message.disclaimer {
  align-self: center;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
body.dark-mode .message.disclaimer {
  background: #3a3d2e;
  color: #e7dca6;
  border: 1px solid #5e5a32;
}

.disclaimer-box {
  margin: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  font-weight: 500;
}


body:not(.dark-mode) .disclaimer-box {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}


body.dark-mode .disclaimer-box {
  background: #2e2e2e;
  color: #ffd369;
  border: 1px solid #444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}


#continue-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  background: #007bff;
  color: white;
  transition: background 0.3s, opacity 0.3s;
}

#continue-btn:disabled {
  background: #a0a0a0;
  cursor: not-allowed;
  opacity: 0.7;
}

.check {
  cursor: pointer;
  position: relative;
  margin: auto;
  width: 18px;
  height: 18px;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(0, 0, 0);
}

.check:before {
  content: "";
  position: absolute;
  top: -15px;
  left: -15px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(34, 50, 84, 0.03);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.check svg {
  position: relative;
  z-index: 1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: #c8ccd4;
  stroke-width: 1.5;
  transform: translate3d(0, 0, 0);
  transition: all 0.2s ease;
}

.check svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
}

.check svg polyline {
  stroke-dasharray: 22;
  stroke-dashoffset: 66;
}

.check:hover:before {
  opacity: 1;
}

.check:hover svg {
  stroke: var(--accent-color, #a3e583);
}

#cbx2:checked + .check svg {
  stroke: var(--accent-color, #a3e583);
}

#cbx2:checked + .check svg path {
  stroke-dashoffset: 60;
  transition: all 0.3s linear;
}

#cbx2:checked + .check svg polyline {
  stroke-dashoffset: 42;
  transition: all 0.2s linear;
  transition-delay: 0.15s;
}

.app {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.chat-card {
  width: 450px;
  height: 90vh;
  background: var(--card-bg-light);
  border-radius: 20px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.4s, box-shadow 0.4s;
}

body.dark-mode .chat-card {
  background: var(--card-bg-dark);
}

.chat-card:hover {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.chat-header {
  background: var(--header-bg-light);
  padding: 10px 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 15px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: background 0.4s;
}

body.dark-mode .chat-header {
  background: var(--header-bg-dark);
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.refresh-btn {
  background-color: #e0e0e0;
}

.header-btn:hover {
  background-color: rgba(255, 255, 255, 0.732);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}

.profile-pic {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-text {
  display: flex;
  flex-direction: column;
}

.profile-text .name {
  font-weight: 500;
  color: white;
}

.profile-text .status {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background-color: #34c759;
  border-radius: 50%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-btn img {
  width: 22px;
  height: 22px;
}

.refresh-btn .dark-icon {
  display: none;
}

body.dark-mode .refresh-btn .light-icon {
  display: none;
}

body.dark-mode .refresh-btn .dark-icon {
  display: block;
}

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

.refresh-btn.rotating {
  animation: rotate-once 0.5s ease-in-out;
}

.Btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: 0.3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  background-color: rgb(255, 65, 65);
}

.sign {
  width: 100%;
  transition-duration: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign svg {
  width: 17px;
}

.sign svg path {
  fill: rgb(255, 255, 255);
}

.text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: white;
  font-size: 1.2em;
  font-weight: 600;
  transition-duration: 0.3s;
}

.Btn:hover {
  width: 45px;
  border-radius: 40px;
  transition-duration: 0.3s;
}

.Btn:active {
  transform: translate(2px, 2px);
}

.chat-box {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--bg-light);
  transition: background 0.4s;
  box-shadow: inset 0 12px 15px -10px var(--header-bg-light);
}

body.dark-mode .chat-box {
  background: var(--bg-dark);
  box-shadow: inset 0 10px 15px -10px var(--header-bg-dark);
}

.message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.user {
  align-self: flex-end;
  background: var(--user-msg-bg-light);
  color: white;
  border-bottom-right-radius: 5px;
}

body.dark-mode .user {
  background: var(--user-msg-bg-dark);
}

.bot {
  align-self: flex-start;
  background: var(--bot-msg-bg-light);
  color: var(--text-light);
  border-bottom-left-radius: 5px;
}

body.dark-mode .bot {
  background: var(--bot-msg-bg-dark);
  color: var(--text-dark);
}

.chat-input-area {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: var(--card-bg-light);
  border-top: 1px solid #e0e0e0;
  transition: background 0.4s;
}

body.dark-mode .chat-input-area {
  background: var(--card-bg-dark);
  border-top: 1px solid #404a6e;
}

#user-input {
  flex: 1;
  background: var(--input-bg-light);
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 12px 18px;
  color: var(--text-light);
  font-size: 16px;
  resize: none;
  outline: none;
  margin-right: 10px;
  transition: border-color 0.3s, background 0.4s, color 0.4s;

  height: 60px;        
  max-height: 120px;   
  overflow-y: auto;   
}

body.dark-mode #user-input {
  background: var(--input-bg-dark);
  color: var(--text-dark);
  border-color: #404a6e;
  body.dark-mode #user-input {
  background: var(--input-bg-dark);
  color: var(--text-dark);
  border-color: #404a6e;
}

}

#user-input:focus {
  border-color: #007bff;
}

#image-input {
  display: none;
}

.upload-btn {
  cursor: pointer;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  color: rgb(0, 0, 0);
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
  background: transparent;
}

.send-btn {
  cursor: pointer;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  color: rgb(0, 0, 0);
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
  background: transparent;
}

body.dark-mode .upload-btn,
body.dark-mode .send-btn {
  color: var(--text-dark);
}

.upload-btn:hover {
  background: #d6dade;
}

.send-btn:hover {
  background: #b8cee6;
}

body.dark-mode .upload-btn:hover,
body.dark-mode .send-btn:hover {
  background: #4a557c;
}

.upload-btn:active,
.send-btn:active {
  transform: scale(0.9);
}

.toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
}

.input {
  display: none;
}

.icon {
  grid-column: 1 / 1;
  grid-row: 1 / 1;
  transition: transform 500ms;
  line-height: 0.1;
}

.icon--moon {
  transition-delay: 200ms;
  color: #b4b4b4;
}

.icon--sun {
  transform: scale(0);
  color: #ffa500;
}

#switch:checked ~ .icon--moon {
  transform: rotate(360deg) scale(0);
}

#switch:checked ~ .icon--sun {
  transition-delay: 200ms;
  transform: scale(1) rotate(360deg);
}

@media (max-width: 1080px) {
  .chat-card {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-card:hover {
    box-shadow: none;
  }

  .modal-content {
    width: 85%;
  }

  .chat-header {
    padding: 10px;
  }

  .profile-pic {
    width: 40px;
    height: 40px;
  }

  .header-btn,
  .Btn {
    width: 40px;
    height: 40px;
  }

  .chat-box {
    padding: 15px;
  }

  .message {
    font-size: 15px;
    padding: 10px 15px;
  }

  .chat-input-area {
    padding: 10px 15px;
  }

  #user-input {
    padding: 10px 15px;
    font-size: 15px;
  }
}

@media (max-width: 600px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-light);
    padding: 10px;
  }

  body.dark-mode {
    background: var(--bg-dark);
  }

  .chat-card {
    width: 95%;
    height: 85vh;
    max-width: 420px;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    margin: auto;
  }

  .chat-header {
    padding: 10px 14px;
  }

  .profile-pic {
    width: 38px;
    height: 38px;
  }

  .header-btn,
  .Btn {
    width: 40px;
    height: 40px;
  }

  .chat-box {
    padding: 15px;
    font-size: 15px;
    gap: 12px;
  }

  .message {
    font-size: 15px;
    padding: 11px 16px;
    max-width: 85%;
  }

  .chat-input-area {
    padding: 12px 14px;
  }

  #user-input {
    font-size: 15px;
    padding: 11px 14px;
    max-height: 120px;
    overflow-y: auto;
  }

  .upload-btn,
  .send-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  .profile-pic {
    width: 45px;
    height: 45px;
  }

  .profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .chat-input-area {
    padding: 10px 14px;
  }

  #user-input {
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 20px;
    height: 45px;
    line-height: 1.4;
    max-height: 90px;
    overflow-y: auto;
  }

  .upload-btn,
  .send-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}


.exit-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.exit-content {
  background: rgba(255, 255, 255, 0.1);
  padding: 25px 35px;
  border-radius: 20px;
  color: #b4b4b4;
  text-align: center;
  width: 320px;
  box-shadow: 0 0 25px rgba(0,0,0,0.4), 0 0 10px rgba(0, 123, 255, 0.3);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.15);
  animation: popIn 0.25s ease;
}

body.dark-mode .exit-content {
  background: rgba(44, 51, 73, 0.75);
  color: var(--text-dark);
  box-shadow: 0 0 25px rgba(0,0,0,0.6), 0 0 15px rgba(0, 140, 255, 0.3);
}

.exit-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.exit-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s;
}

.exit-btn.yes {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 65, 108, 0.4);
}

.exit-btn.no {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.exit-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.image-preview {
  position: relative;
  display: inline-block;
  margin-right: 10px;
}

.image-preview img {
  max-width: 120px;
  max-height: 100px;
  border-radius: 10px;
  object-fit: cover;
}

.image-preview .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
