/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Gemini-inspired Dark Theme Palette - Changed blues to grays */
  --background: #131314;
  --surface: #282a2c;
  --primary: #2d2e30;
  --accent: #5865F2; /* Only send button keeps blue */
  --accent-gray: #6b7280; /* Gray for other buttons */
  --text-primary: #e3e3e3;
  --text-secondary: #bdc1c6;
  --text-muted: #969ba1;
  --border: #3c4043;
  --error: #f28b82;
  --gold: #fdd663;
  --text-h1: #e3e3e3; /* Changed from blue to gray */
}

body {
  display: flex;
  flex-direction: row;
  width: 100vw;
  font-family: system-ui, -apple-system, "Inter", "Roboto", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--background);
  color: var(--text-primary);
  overflow-x: hidden;
}

.wrapper {
  display: flex;
  width: 100%;
}

/* Animated starry background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(135deg, var(--background) 0%, var(--primary) 100%);
}

.stars::before,
.stars::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

.stars::before {
  top: 20%;
  left: 30%;
  animation-delay: 0s;
}

.stars::after {
  top: 60%;
  left: 70%;
  animation-delay: 1.5s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Sidebar styles - DESKTOP */
.navigation-container {
  display: flex;
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  transition: left 0.3s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.navigation-container::-webkit-scrollbar {
  display: none;
}

.top-section {
  display: none;
}

.main-section {
  display: flex;
  opacity: 1;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  padding: 5px 10px 10px 10px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
}

.main-section::-webkit-scrollbar {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  flex-shrink: 0;
  position: relative;
  padding: 0 1rem;
}

.sidebar-title {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.sidebar-close-mobile {
  display: none;
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-close-mobile:hover {
  background: var(--border);
  color: var(--text-primary);
}

.sidebar-close-mobile:active {
  transform: scale(0.95);
}

/* Gray button style for New Chat */
.new-chat-sidebar {
  background: var(--accent-gray);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.new-chat-sidebar:hover {
  background: #4b5563;
}

.new-chat-sidebar:active {
  transform: scale(0.98);
}

/* === Sidebar Footer === */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer .login-btn,
.sidebar-footer .logout-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* === LANGUAGE SLIDER === */
.lang-slider {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
    height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.lang-slider-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--accent-gray);
    border-radius: 18px;
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.lang-slider.ru-active .lang-slider-bg {
    left: 50%;
}

.lang-option {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    z-index: 2;
    transition: color 0.3s ease;
    user-select: none;
}

.lang-slider:not(.ru-active) .lang-option[data-lang="uk"],
.lang-slider.ru-active .lang-option[data-lang="ru"] {
    color: white;
}

/* Gray logout button */
.logout-btn {
  background: var(--accent-gray);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.logout-btn:hover {
  background: #4b5563;
}

.logout-btn:active {
  transform: scale(0.98);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--primarydark);
  border-radius: 8px;
  min-height: 70px;
  flex-shrink: 0;
}

.user-avatar {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding: 0 0.5rem;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
}

.chat-history::-webkit-scrollbar {
  display: none;
}

.chat-history-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--primarydark);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 0.5rem;
  min-height: 48px;
}

.chat-content {
  flex: 1;
  cursor: pointer;
  min-width: 0;
  padding-right: 0.5rem;
}

.chat-history-item:hover {
  background: var(--secondary);
}

/* Remove old desktop actions completely */
.chat-actions,
.desktop-actions {
  display: none !important;
}

/* Three dots menu button - always visible on all devices */
.chat-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.chat-menu-btn:hover {
  background: var(--border);
  color: var(--text-primary);
  opacity: 1;
}

.chat-menu-btn:active {
  transform: scale(0.95);
  background: var(--border);
}

/* Dropdown menu */
.chat-dropdown-menu {
  position: absolute;
  right: 0.5rem;
  top: calc(100% - 0.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  min-width: 150px;
  display: none;
  overflow: hidden;
  margin-top: 0.25rem;
}

.chat-dropdown-menu.show {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.875rem;
  text-align: left;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--primary);
}

.dropdown-item.delete-item {
  color: var(--error);
}

.dropdown-item.delete-item:hover {
  background: rgba(242, 139, 130, 0.1);
}

.rename-chat-btn,
.delete-chat-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.875rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rename-chat-btn:hover {
  background: var(--accent-gray);
  color: white;
}

.delete-chat-btn:hover {
  background: var(--error);
  color: white;
}

.chat-rename-input {
  background: var(--background);
  border: 1px solid var(--accent-gray);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  outline: none;
}

.chat-rename-input:focus {
  border-color: var(--accent-gray);
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.chat-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title:hover {
  color: var(--accent-gray);
}

/* Header styles */
.header {
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  width: 100%;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--border);
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s;
}

.menu-btn-mobile {
  display: none;
}

.menu-btn-desktop {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Work Sans", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.logo-header {
    display: none;
}

.zodiac-icon {
  font-size: 1.5rem;
  color: var(--gold);
}

/* Gray login button */
.login-btn {
  background: var(--accent-gray);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.login-btn:hover {
  background: #4b5563;
}

/* === MAIN CHAT CONTAINER === */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    margin-left: 320px;
    position: relative;
    z-index: 1;
}

.chat-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: justify-content 0.3s ease;
}

.main-content {
    width: 100%;
    max-width: 720px;
    padding: 1rem;
}

.main-content::-webkit-scrollbar {
  display: none;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

/* Large rotating subtitle text */
.welcome-subtitle-large {
  font-family: "Work Sans", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 650px;
  margin: 0;
}

/* Welcome screen input uses same wrapper as main input */
#welcomeInputWrapper {
  max-width: 720px;
  width: 100%;
}

.suggested-questions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 720px;
}

.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    width: calc(50% - 1rem);
    max-width: 250px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-primary);
}

.question-card:hover {
    border-color: var(--accent-gray);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.question-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.question-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Messages */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-container.chat-active .messages-container {
    &::-webkit-scrollbar {
        display: none;
    }
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--accent);
  color: white;
}

.message.assistant .message-avatar {
  background: var(--gold);
  color: var(--primary);
}

.message-content {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 16px;
  width: fit-content;
  max-width: calc(100% - 60px);
  word-wrap: break-word;
  position: relative;
}

.message.user .message-content {
  background: var(--accent);
  color: white;
}

/* Blurred message for subscription */
.message-content.blurred {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
}

.message-text {
  line-height: 1.6;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.message.user .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* === EDIT MESSAGE BUTTON STYLES (ChatGPT Style) === */
.edit-message-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
  color: inherit;
  margin-left: 0.375rem;
  transition: all 0.15s ease;
  opacity: 0.5;
  vertical-align: middle;
}

.edit-message-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.edit-message-btn:active {
  transform: scale(0.95);
}

.edit-message-btn svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

/* For user messages (blue background) */
.message.user .edit-message-btn {
  color: rgba(255, 255, 255, 0.6);
}

.message.user .edit-message-btn:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Edit container styles */
.edit-message-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.edit-message-input {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
}

.edit-message-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.1);
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.typing-indicator.show {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Input area */
.input-container {
  padding: 1rem;
  width: 100%;
  flex-shrink: 0;
}

/* === CONFIDENTIALITY NOTICE === */
.confidentiality-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    margin: 0 auto 0.75rem;
    max-width: 720px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

.confidentiality-notice svg {
    flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  background: var(--surface);
  border-radius: 28px;
  padding: 0.5rem;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--surface);
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--border);
}

.message-input {
  flex: 1;
  background: transparent;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  min-height: 24px;
  max-height: 160px;
}

.message-input::-webkit-scrollbar {
  width: 6px;
}

.message-input::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

.message-input::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.message-input::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.message-input:focus {
  outline: none;
}

/* Regenerate button */
.regenerate-btn {
  background: var(--accent-gray);
  color: white;
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.regenerate-btn:hover {
  background: #4b5563;
  transform: rotate(180deg);
}

/* Send button - keeps blue color */
.send-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: fit-content;
    padding: 0 1.25rem;
}

.send-btn:hover:not(:disabled) {
    background: #4c5be2;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn-text {
    display: inline;
    font-weight: 600;
    white-space: nowrap;
}

.send-btn-icon {
    display: none;
    width: 20px;
    height: 20px;
}

/* === ACTIVE CHAT STYLES === */

.chat-container.chat-active .chat-body {
    justify-content: space-between;
}

.chat-container.chat-active .welcome-container {
    display: none;
}

.chat-container.chat-active .main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    min-height: 0;
}

.chat-container.chat-active .messages-container {
    flex-grow: 1;
    overflow-y: scroll;
    padding: 1rem;
    height: 250px;
}

.chat-container.chat-active .send-btn {
    width: 50px;
    padding: 0;
}

.chat-container.chat-active .send-btn-text {
    display: none;
}

.chat-container.chat-active .send-btn-icon {
    display: inline;
}

/* Authentication modal */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.auth-overlay.show {
  display: flex;
}

.auth-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  border: 1px solid var(--border);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  z-index: 100;
}

/* Better close button visibility on mobile */
@media (max-width: 768px) {
  .close-btn {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
  }
}

.close-btn:hover {
  background: var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-family: "Work Sans", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.google-signin-btn,
.apple-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.google-signin-btn {
  background: white;
  color: #1f2937;
}

.google-signin-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.apple-signin-btn {
  background: #000000;
  color: white;
  border-color: #000000;
}

.apple-signin-btn:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.google-signin-btn:active,
.apple-signin-btn:active {
  transform: translateY(0);
}

.demo-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Subscription Modal */
.subscription-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 1rem;
}

/* === OPTIMIZED SUBSCRIPTION MODAL STYLES === */
/* Replace the existing .subscription-overlay and related styles in your styles.css */

.subscription-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(10px);
  padding: 1rem;
}

.subscription-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Desktop optimized modal */
.subscription-modal {
  background: linear-gradient(135deg, #1a1b2e 0%, #2d1b69 100%);
  border-radius: 24px;
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  position: relative;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 20px 60px rgba(138, 43, 226, 0.4);
  display: flex;
  flex-direction: column;
}

/* Compact header */
.subscription-header {
  text-align: center;
  margin-bottom: 1rem;
}

.cosmic-stars {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

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

.subscription-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.subscription-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  line-height: 1.3;
}

/* Compact blurred message */
.blurred-message {
  position: relative;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  min-height: 60px;
}

.blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(10px);
  z-index: 1;
}

.blurred-message p {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  position: relative;
  z-index: 2;
  font-size: 0.875rem;
  margin: 0;
}

/* Compact plans */
.subscription-plans {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.plan-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.plan-card.special-offer {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.plan-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1a1b2e;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.plan-name {
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  margin-top: 0.5rem;
}

.plan-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.35rem;
  line-height: 1;
}

.plan-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.plan-button {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.plan-button:hover {
  background: #4c5be2;
  transform: scale(1.05);
}

.close-subscription {
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.close-subscription:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Large desktop adjustments */
@media (min-width: 1440px) {
  .subscription-modal {
    padding: 2rem;
    max-width: 520px;
  }

  .subscription-title {
    font-size: 1.75rem;
  }

  .plan-price {
    font-size: 2rem;
  }

  .plan-button {
    padding: 0.75rem;
  }
}

/* Laptop/smaller desktop */
@media (max-height: 768px) and (min-width: 769px) {
  .subscription-modal {
    padding: 1.25rem;
  }

  .subscription-header {
    margin-bottom: 0.75rem;
  }

  .cosmic-stars {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
  }

  .subscription-title {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
  }

  .blurred-message {
    padding: 0.75rem;
    min-height: 50px;
  }

  .plan-card {
    padding: 0.875rem;
  }

  .plan-price {
    font-size: 1.5rem;
  }

  .plan-button {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Mobile styles remain mostly unchanged */
@media (max-width: 768px) {
  .subscription-overlay {
    padding: 0;
  }

  .subscription-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 1.5rem;
    margin: 0;
    overflow-y: auto;
  }

  .subscription-header h2 {
    font-size: 1.5rem;
  }

  .subscription-header p {
    font-size: 0.9rem;
  }

  .plan-card {
    padding: 1rem;
  }

  .plan-price {
    font-size: 1.75rem;
  }

  .subscription-plans {
    flex-direction: column;
  }
}

/* Very small desktop screens */
@media (max-height: 650px) and (min-width: 769px) {
  .subscription-modal {
    padding: 1rem;
    max-height: 95vh;
  }

  .subscription-header {
    margin-bottom: 0.5rem;
  }

  .cosmic-stars {
    display: none;
  }

  .subscription-title {
    font-size: 1.25rem;
  }

  .subscription-subtitle {
    font-size: 0.75rem;
  }

  .blurred-message {
    display: none;
  }

  .plan-card {
    padding: 0.75rem;
  }

  .plan-name {
    font-size: 0.875rem;
  }

  .plan-price {
    font-size: 1.35rem;
  }

  .plan-description {
    display: none;
  }

  .plan-button {
    padding: 0.45rem;
    font-size: 0.75rem;
  }
}

.plan-button:hover {
  background: #4c5be2;
  transform: scale(1.05);
}

.payment-methods {
  text-align: center;
  margin-bottom: 1.5rem;
}

.payment-methods p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.payment-method {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: 500;
}

.payment-method:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.payment-method img {
  height: 20px;
  vertical-align: middle;
}

.close-subscription {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.close-subscription:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Discount Popup */
.discount-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  backdrop-filter: blur(10px);
}

.discount-overlay.show {
  display: flex;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.discount-modal {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
  border-radius: 24px;
  padding: 2.5rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(255, 107, 107, 0.4);
}

.discount-badge {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

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

.discount-title {
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.discount-text {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.discount-price {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.old-price {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.new-price {
  font-size: 3rem;
  font-weight: 700;
  color: white;
}

.discount-accept {
  width: 100%;
  padding: 1rem;
  background: white;
  color: #ff6b6b;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.discount-accept:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.discount-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.discount-reject:hover {
  color: white;
}

/* Scroll to bottom button */
.scroll-to-bottom-btn {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.scroll-to-bottom-btn:hover {
    background: var(--primary);
    border-color: var(--accent-gray);
}

.scroll-to-bottom-btn.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =============================================== */
/* === MOBILE STYLES === */
/* =============================================== */
@media (max-width: 768px) {
  body {
    overflow: hidden;
    height: 100%;
  }

  .chat-container {
    height: 100vh;
    height: 100dvh;
    margin-left: 0;
    overflow: hidden;
  }

  .chat-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
  }

  .input-container {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
  }

  .navigation-container {
    width: 280px;
    left: -280px;
    height: 100%;
    height: 100dvh;
    overflow-y: auto;
  }

  .menu-btn-mobile { display: flex; }
  .menu-btn-desktop { display: none; }
  .sidebar-close-mobile { display: flex; }
  .navigation-container.open { left: 0; }
  .logo-sidebar { display: none; }
  .logo-header { display: flex; }
  .sidebar-header { justify-content: flex-end; }
  .top-section { display: flex; position: static; border: none; background: transparent; }
  .main-section { margin-top: 0; padding: 10px; }
  .sidebar-overlay.show { display: block; }
  .welcome-subtitle-large { font-size: 1.8rem; }
  .welcome-container { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .messages-container { padding: 0; }

  .message-input::placeholder {
    font-size: 0.9rem;
  }

  .welcome-message-input::placeholder {
    font-size: 0.9rem;
  }

  /* Chat history mobile styles */
  .chat-history-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.75rem;
  }

  /* Make sure dropdown menu appears correctly on mobile */
  .chat-dropdown-menu {
    position: fixed !important;
    right: 1rem;
    top: auto;
    z-index: 10000;
  }

  /* Make chat content take available space */
  .chat-content {
    flex: 1;
    padding-right: 0;
  }

  /* Ensure chat title is clickable and takes full width */
  .chat-title {
    display: block;
    width: 100%;
  }

  /* Edit button adjustments for mobile */
  .edit-message-btn {
    padding: 4px 6px;
    margin-left: 0.5rem;
  }

  .edit-message-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Subscription modal mobile styles */
  .subscription-overlay {
    padding: 0;
  }

  .subscription-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 1.5rem;
    margin: 0;
  }

  .subscription-header h2 {
    font-size: 1.5rem;
  }

  .subscription-header p {
    font-size: 0.9rem;
  }

  .plan-card {
    padding: 1rem;
  }

  .plan-price {
    font-size: 1.75rem;
  }

  .plan-features {
    font-size: 0.9rem;
  }

  .payment-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .payment-btn {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .subscription-plans {
    flex-direction: column;
  }
}

/* Very small mobile devices */
@media (max-width: 380px) {
  .subscription-modal {
    padding: 1rem;
  }

  .subscription-header h2 {
    font-size: 1.25rem;
  }

  .plan-price {
    font-size: 1.5rem;
  }

  .plan-features li {
    font-size: 0.85rem;
    padding: 0.4rem 0;
  }

  .payment-btn {
    padding: 0.875rem;
    font-size: 0.9rem;
  }
}
/* Updated portion of styles.css - Typing indicator and Premium badge styles */

/* === TYPING INDICATOR - IMPROVED === */
.typing-indicator {
  padding: 0 1rem;
  margin-top: 1rem;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.typing-indicator.show {
  display: block;
  opacity: 1;
}

.typing-message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.typing-content {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 16px;
  min-width: 80px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
}

.typing-dot {
  width: 10px;
  height: 10px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
  opacity: 0.4;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: scale(0.8) translateY(0);
  }
  30% {
    opacity: 1;
    transform: scale(1) translateY(-4px);
  }
}

/* === PREMIUM BADGE === */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  animation: shimmer 3s infinite;
}

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

/* === LANGUAGE SLIDER UPDATE FOR UK/EN === */
.lang-slider {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    flex: 1;
    max-width: calc(50% - 0.5rem);
    height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.lang-slider-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--accent-gray);
    border-radius: 18px;
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.lang-slider.en-active .lang-slider-bg {
    left: 50%;
}

.lang-option {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    z-index: 2;
    transition: color 0.3s ease;
    user-select: none;
}

.lang-slider:not(.en-active) .lang-option[data-lang="uk"],
.lang-slider.en-active .lang-option[data-lang="en"] {
    color: white;
}

/* === TERMS OF SERVICE BUTTON === */
.terms-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    min-height: 44px;
    height: 44px;
    transition: all 0.2s;
    flex: 1;
    max-width: calc(50% - 0.5rem);
    white-space: nowrap;
    text-decoration: none;
}

.terms-btn:hover {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--accent-gray);
}

.terms-btn:active {
    transform: scale(0.98);
}

.lang-terms-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
    margin-bottom: 0.75rem;
}

/* === SIDEBAR FOOTER UPDATE === */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer .login-btn,
.sidebar-footer .logout-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.subscription-close-x {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  z-index: 100;
  line-height: 1;
}

.subscription-close-x:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

/* === UPGRADE BUTTON === */
.upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-gray);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.upgrade-btn:hover {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.upgrade-btn:active {
  transform: translateY(0);
}