
:root {
  --bg-main: #111111;
  --bg-sidebar: #181818;
  --bg-card: #1f1f1f;
  --bg-input: #1a1a1a;
  --bg-input-hover: #242424;
  --text-main: #ffffff;
  --text-muted: #9e9e9e;
  --accent-blue: #38bdf8;
  --accent-purple: #c58af9;
  --border-color: rgba(255, 255, 255, 0.08);
  --sidebar-width: 280px;
}

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

body {
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Background Subtle Radial Glow */
body::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.08) 0%, rgba(19, 19, 20, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* App Container */
.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  box-sizing: border-box;
}

.brand-logo-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  text-decoration: none;
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo-hover-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.brand-logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.sidebar-actions {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-chat-btn,
.converter-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.new-chat-btn svg,
.converter-nav-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.new-chat-btn:hover,
.converter-nav-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.new-chat-btn:hover svg {
  color: var(--accent-blue);
}

.new-chat-btn:active,
.converter-nav-btn:active {
  transform: scale(0.98);
}

.sidebar-nav-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.nav-tag-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tag-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.35);
  color: #00f2fe;
}

/* History List */
.sidebar-history-section {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 8px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  margin: 0;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover, .history-item.active, .history-item.menu-open {
  background-color: rgba(255, 255, 255, 0.06);
}

.history-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.history-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13.5px;
}

.history-pin-badge {
  display: inline-flex;
  align-items: center;
  color: #00f2fe;
  flex-shrink: 0;
  margin-left: 2px;
}

.history-more-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9aa0a6;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  transition: all 0.2s;
}

.history-item:hover .history-more-btn,
.history-item.menu-open .history-more-btn {
  display: flex;
}

.history-more-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.history-more-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Collapsed Mini Rail Sidebar Mode (Desktop) */
@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 68px !important;
  }

  .sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 14px 8px;
  }

  .sidebar.collapsed .sidebar-toggle-btn,
  .sidebar.collapsed .brand-logo-text {
    display: none !important;
  }

  .sidebar.collapsed .brand-logo-toggle {
    width: 40px;
    height: 40px;
    justify-content: center;
  }

  .sidebar.collapsed .brand-logo-toggle:hover .brand-logo-img {
    opacity: 0;
  }

  .sidebar.collapsed .brand-logo-toggle:hover .brand-logo-hover-icon {
    display: flex;
  }

  .sidebar.collapsed .sidebar-actions {
    padding: 10px 8px;
    align-items: center;
    gap: 12px;
  }

  .sidebar.collapsed .new-chat-btn,
  .sidebar.collapsed .converter-nav-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    margin: 0 auto;
  }

  .sidebar.collapsed .action-btn-text {
    display: none;
  }

  .sidebar.collapsed .sidebar-nav-btns {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
  }

  .sidebar.collapsed .nav-tag-btn {
    width: 44px;
    height: 32px;
    padding: 0;
    justify-content: center;
    font-size: 11px;
  }

  .sidebar.collapsed .sidebar-history-section {
    display: none;
  }

  .sidebar.collapsed .sidebar-footer {
    margin-top: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .sidebar.collapsed .sidebar-settings-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    margin: 0 auto;
  }

  .sidebar.collapsed .sidebar-login-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    margin: 0 auto;
  }

  .sidebar.collapsed .settings-btn-text,
  .sidebar.collapsed .sidebar-login-text,
  .sidebar.collapsed .user-details {
    display: none !important;
  }

  .sidebar.collapsed .user-profile-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    margin: 0 auto;
  }

  .sidebar.collapsed .user-avatar {
    width: 36px;
    height: 36px;
    margin: 0 auto;
  }
}

/* User Profile & Settings in Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: #93c5fd;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.sidebar-login-btn:hover {
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(37, 99, 235, 0.55);
  color: #ffffff;
}

.login-btn-icon-circle {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text-main);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  box-sizing: border-box;
}

.sidebar-settings-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #00f2fe;
}

.sidebar-settings-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.user-profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5e62, #ff9966);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img, .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 11.5px;
  color: var(--accent-blue);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Top Navigation Bar on Mobile / Desktop */
.main-top-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
}

/* Chat Messages Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Center Greeting (Initial State) */
.center-greeting-box {
  margin: auto 0;
  text-align: center;
  max-width: 680px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
}

.greeting-glow-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(0, 242, 254, 0.22) 0%, rgba(99, 102, 241, 0.12) 40%, rgba(0, 0, 0, 0) 72%);
  filter: blur(55px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.greeting-title {
  font-size: 38px;
  font-weight: 600;
  line-height: 1.25;
  background: linear-gradient(135deg, #ffffff 20%, #e0e7ff 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0, 242, 254, 0.25));
}

.greeting-subtitle {
  font-size: 15.5px;
  color: #94a3b8;
  max-width: 500px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Message Stream */
.messages-stream {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.msg-row {
  display: flex;
  gap: 16px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.msg-row.user-msg {
  justify-content: flex-end;
}

.user-bubble {
  background-color: var(--bg-card);
  padding: 12px 20px;
  border-radius: 20px;
  max-width: 75%;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
}

.ai-card {
  display: flex;
  gap: 14px;
  width: 100%;
}

.ai-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-prompt-meta {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  border-left: 3px solid var(--accent-purple);
}

.ai-text-bubble {
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.65;
  background: transparent;
  max-width: 100%;
}

.ai-text-bubble p {
  margin-bottom: 12px;
}

.ai-text-bubble p:last-child {
  margin-bottom: 0;
}

.ai-text-bubble strong, .ai-text-bubble b {
  color: #ffffff;
  font-weight: 600;
}

.ai-text-bubble h1, .ai-text-bubble h2, .ai-text-bubble h3, .ai-text-bubble h4 {
  color: #ffffff;
  margin: 16px 0 8px 0;
  font-weight: 600;
  line-height: 1.35;
}

.ai-text-bubble h1 { font-size: 20px; }
.ai-text-bubble h2 { font-size: 18px; }
.ai-text-bubble h3 { font-size: 16px; }

.ai-text-bubble ul, .ai-text-bubble ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.ai-text-bubble li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.ai-text-bubble blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 12px;
  color: #94a3b8;
  margin: 10px 0;
}

.ai-text-bubble code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  color: #38bdf8;
}

.ai-text-bubble pre {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 12px 0;
}

.ai-text-bubble pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

.ai-text-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
  border-radius: 10px;
  overflow: hidden;
}

.ai-text-bubble th, .ai-text-bubble td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.ai-text-bubble th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  color: #ffffff;
}

.ai-text-bubble tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.ai-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.ai-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ai-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

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

.ai-action-btn.success {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

/* AI Sparkling Star / Thinking Indicator */
.ai-thinking-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 18px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.ai-thinking-stars {
  width: 36px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.ai-sparkle-star {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.ai-thinking-text {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-thinking-dots span {
  animation: dotPulse 1.4s infinite ease-in-out both;
  display: inline-block;
}
.ai-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 7px;
  height: 16px;
  background: #38bdf8;
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 2px;
  animation: cursorBlink 0.7s infinite;
}

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

.image-card-container {
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 540px;
  border: 1px solid var(--border-color);
}

.image-card-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.image-card-actions {
  padding: 12px 16px;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.download-btn {
  background: var(--accent-blue);
  color: #0b1420;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.download-btn:hover {
  background: #99c0ff;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  padding: 10px 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Bottom Input Bar (Clean Pill Box) */
.input-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 10px 20px 14px;
  background: linear-gradient(to top, var(--bg-main) 75%, rgba(19, 19, 20, 0));
  z-index: 10;
}

.input-disclaimer {
  font-size: 11.5px;
  color: var(--text-muted);
  opacity: 0.72;
  text-align: center;
  line-height: 1.4;
  user-select: none;
  letter-spacing: 0.1px;
}

.input-box {
  width: 100%;
  max-width: 780px;
  background-color: var(--bg-input);
  border-radius: 28px;
  padding: 6px 8px 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.input-box:focus-within {
  background-color: var(--bg-input-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  padding: 8px 0;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  opacity: 0.35;
  margin-right: 2px;
}

.send-btn.active {
  background: #229ED9;
  color: #fff;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(34, 158, 217, 0.35);
}

.send-btn.active:hover {
  background: #1e8ec3;
  transform: scale(1.05);
}

.send-btn-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.token-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
}

.token-input-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
  margin-left: 2px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Welcome Video Modal (Landing Onboarding) */
.welcome-modal-card {
  max-width: 480px;
  width: 92%;
  padding: 20px 22px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(18, 22, 32, 0.94);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  position: relative;
}

.welcome-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.welcome-brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.welcome-video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  position: relative;
  margin-bottom: 14px;
  background: #06090e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.welcome-video-elem {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.welcome-content-body {
  text-align: left;
  margin-bottom: 18px;
}

.welcome-title {
  font-size: 17.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.welcome-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

.welcome-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.welcome-login-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.welcome-login-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.google-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.welcome-google-btn {
  width: auto;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.google-auth-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

.google-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.auth-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  width: 100%;
}

.auth-modal-divider::before,
.auth-modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* Liquid Glass Modal System */
.modal-content.liquid-glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(16, 20, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  width: 90%;
  max-width: 440px;
  padding: 26px;
  box-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.modal-content.liquid-glass-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.22) 0%, rgba(79, 172, 254, 0) 70%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(20px);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.modal-icon-badge.liquid-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18) 0%, rgba(79, 172, 254, 0.08) 100%), rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 8px 24px -4px rgba(0, 242, 254, 0.25);
}

.lock-svg-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 6px rgba(0, 242, 254, 0.4));
}

.modal-header-text {
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #ffffff;
  margin: 0;
}

.modal-subtitle {
  font-size: 12.5px;
  color: #9aa0a6;
  margin-top: 2px;
}

.modal-close-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: rotate(90deg);
}

.token-info-box.liquid-glass-inset {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(20, 26, 38, 0.4);
  border: 1px solid rgba(0, 242, 254, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 15px 16px;
  margin-bottom: 18px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.token-info-text {
  font-size: 13.5px;
  color: #a0aec0;
  margin: 0 0 6px 0;
  line-height: 1.45;
}

.token-info-sub {
  font-size: 13px;
  color: #d2d6dc;
  margin: 0;
  line-height: 1.5;
}

.token-info-sub b {
  color: #00f2fe;
}

.token-input-wrapper {
  position: relative;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
}

.token-input-field.liquid-glass-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  letter-spacing: 0.3px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.token-input-field.liquid-glass-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.52);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.08);
}

#tokenInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#customNameInput {
  font-family: inherit;
}

/* High-Tech Liquid Scanner Animation */
.modal-icon-badge.liquid-icon-badge {
  position: relative;
}

.icon-scan-ring {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid transparent;
  border-top-color: #00f2fe;
  border-right-color: #4facfe;
  display: none;
}

.modal-icon-badge.scanning-active .icon-scan-ring {
  display: block;
  animation: spinRing 0.9s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.token-input-wrapper.scanning {
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.input-scan-beam {
  position: absolute;
  top: 0;
  left: -80px;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.35), rgba(79, 172, 254, 0.6), transparent);
  pointer-events: none;
  display: none;
  filter: blur(4px);
}

.token-input-wrapper.scanning .input-scan-beam {
  display: block;
  animation: laserBeam 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes laserBeam {
  0% { left: -80px; }
  50% { left: 100%; }
  100% { left: -80px; }
}

.input-scan-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, transparent, #00f2fe, #4facfe, transparent);
  box-shadow: 0 0 8px #00f2fe;
  transition: width 0.3s ease;
  pointer-events: none;
}

.token-input-wrapper.scanning .input-scan-line {
  width: 50%;
  animation: scanLine 1.2s infinite ease-in-out;
}

@keyframes scanLine {
  0% { left: -50%; }
  50% { left: 100%; }
  100% { left: -50%; }
}

.scan-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #00f2fe;
  margin-top: -4px;
  margin-bottom: 14px;
  padding: 7px 12px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 12px;
  animation: fadeIn 0.25s ease;
}

.scan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
  animation: pulseDot 0.8s ease-in-out infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Error Notification Box */
.token-error-box {
  background: linear-gradient(135deg, rgba(235, 87, 87, 0.14) 0%, rgba(235, 87, 87, 0.05) 100%);
  border: 1px solid rgba(235, 87, 87, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
  animation: shakeError 0.4s ease;
}

.error-badge-icon {
  flex-shrink: 0;
  display: flex;
  margin-top: 1px;
}

.error-svg-icon {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(255, 82, 82, 0.3));
}

.error-badge-text {
  font-size: 12.8px;
  line-height: 1.48;
  color: #fca5a5;
}

.error-support-link {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.error-support-link:hover {
  color: #93c5fd;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Liquid Glass Unified Buttons */
.modal-btn-primary.liquid-glass-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #0072ff 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  padding: 13px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 6px 20px -2px rgba(0, 242, 254, 0.32), inset 0 1px 2px rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-btn-primary.liquid-glass-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px -2px rgba(0, 242, 254, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.55);
}

.modal-btn-primary.liquid-glass-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 12px rgba(0, 242, 254, 0.3);
}

.modal-btn-telegram.liquid-glass-btn-telegram {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.12) 0%, rgba(79, 172, 254, 0.06) 100%), rgba(255, 255, 255, 0.04);
  color: #d8f5ff;
  border: 1px solid rgba(0, 242, 254, 0.32);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  padding: 13px;
  border-radius: 16px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 4px 14px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.modal-btn-telegram.liquid-glass-btn-telegram:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.22) 0%, rgba(79, 172, 254, 0.12) 100%), rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 242, 254, 0.5);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.modal-btn-telegram.liquid-glass-btn-telegram:active {
  transform: translateY(1px);
}

/* Spinner inside button */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Profile Details Box (Matching Login Page Theme) */
.profile-modal-card {
  background: #181818 !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 26px !important;
  width: 92% !important;
  max-width: 460px !important;
  padding: 24px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-title-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #38bdf8;
}

.profile-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 0;
}

.profile-modal-close-btn {
  background: #232323;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-modal-close-btn:hover {
  background: #333333;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* User Identity Hero */
.profile-user-hero {
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-provider-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #181818;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.profile-provider-badge svg,
.profile-provider-badge img {
  width: 12px;
  height: 12px;
}

.profile-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.profile-user-name {
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.profile-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-user-handle {
  font-size: 12.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.profile-meta-dot {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.profile-id-chip {
  background: #282828;
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.profile-id-chip:hover {
  background: #333333;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.profile-id-chip:active {
  transform: translateY(0);
}

/* Monthly Subscription Box (Subtle, matching dark background) */
.profile-sub-section {
  display: flex;
  flex-direction: column;
}

.profile-sub-card {
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.profile-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-sub-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-sub-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.profile-sub-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.profile-sub-status {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
}

.profile-sub-status.active {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.profile-sub-desc {
  font-size: 11.5px;
  color: #94a3b8;
  margin-left: 38px;
}

/* Logout Button */
.btn-logout-modern {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.22);
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-logout-modern:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

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

@media (max-width: 480px) {
  .profile-modal-card {
    padding: 18px !important;
    gap: 14px;
    border-radius: 20px !important;
  }
  .profile-stats-grid-modern {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .profile-user-hero {
    padding: 12px;
    gap: 12px;
  }
  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -280px;
    height: 100%;
  }

  .sidebar.open {
    transform: translateX(280px);
  }

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

  .greeting-title {
    font-size: 28px;
  }

  .input-section {
    padding: 8px 12px 16px;
  }
}

/* History Floating Context Menu (Matching Login Page Theme) */
.history-context-menu {
  position: fixed;
  z-index: 1200;
  background: #1d1d1d;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  min-width: 195px;
  display: none;
  flex-direction: column;
  gap: 2px;
  animation: popInMenu 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popInMenu {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
  font-family: inherit;
}

.ctx-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.ctx-btn.ctx-danger {
  color: #f87171;
}

.ctx-btn.ctx-danger:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.ctx-icon {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}

.ctx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 6px;
}

/* Rename & Delete Dialog Modals */
.rename-modal-content, .delete-modal-content {
  max-width: 380px;
  width: 90%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(20, 24, 34, 0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.18);
}

.rename-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.rename-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.delete-modal-text {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 14px 0 20px 0;
}

.rename-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-action-btn {
  padding: 9px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.confirm-btn {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.confirm-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.danger-confirm-btn {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.danger-confirm-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Toast Notification (Matching Login Page Theme) */
.toast-notification {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(25px);
  background: #1e1e1e;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  padding: 11px 20px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  width: max-content;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: brightness(0) invert(1);
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SETTINGS MODAL & CONTROLS (Liquid Glass Theme)
   ========================================================================== */
.settings-modal-card {
  background: #181818 !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 26px !important;
  width: 92% !important;
  max-width: 980px !important;
  height: 640px !important;
  max-height: 85vh !important;
  padding: 24px 28px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.settings-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-title-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #38bdf8;
}

.settings-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 0;
}

.settings-modal-close-btn {
  background: #232323;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-modal-close-btn:hover {
  background: #333333;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.settings-modal-body {
  display: flex;
  gap: 24px;
  height: calc(100% - 54px);
  min-height: 440px;
}

/* Left Navigation Tabs */
.settings-nav {
  width: 215px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding-right: 16px;
}

.settings-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  font-family: inherit;
}

.settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.settings-nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.settings-nav-btn svg {
  flex-shrink: 0;
}

/* Content Area & Panels */
.settings-content-wrapper {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.settings-content-wrapper::-webkit-scrollbar {
  width: 5px;
}

.settings-content-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  margin-bottom: 2px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  transition: border-color 0.2s ease;
}

.settings-row:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.settings-row-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
}

.settings-row-desc {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* Custom Select Dropdown */
.settings-select {
  background: #282828;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.settings-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: #2e2e2e;
}

.settings-select option {
  background: #1f1f1f;
  color: #ffffff;
}

/* Custom iOS/macOS Toggle Switch */
.finvara-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.finvara-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #333333;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.finvara-switch input:checked + .switch-slider {
  background-color: #10b981;
  border-color: #059669;
}

.finvara-switch input:checked + .switch-slider:before {
  transform: translateX(18px);
}

/* Settings Action & Danger Buttons */
.settings-btn-action {
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.settings-btn-danger {
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.settings-danger-row {
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.text-danger {
  color: #f87171 !important;
}

/* About Panel Styling */
.settings-about-hero {
  text-align: center;
  padding: 16px 12px;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.settings-about-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.settings-about-name {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.settings-about-version {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.settings-about-desc {
  font-size: 12px;
  color: #94a3b8;
  max-width: 400px;
  margin-top: 4px;
  line-height: 1.45;
}

.settings-ecosystem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-eco-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.settings-eco-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  background: #242424;
}

.settings-eco-card img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.eco-card-text {
  min-width: 0;
}

.eco-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-card-sub {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-about-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  margin-top: 14px;
}

.settings-footer-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.settings-footer-link:hover {
  color: #38bdf8;
}

.settings-footer-dot {
  color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   KEYBOARD SHORTCUTS & COMMANDS STYLING
   ========================================================================== */
.shortcut-list-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.shortcut-item-row:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: #232323;
}

.shortcut-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.shortcut-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
}

.shortcut-desc {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 25px;
  padding: 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 2px solid rgba(255, 255, 255, 0.26);
  border-radius: 7px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  user-select: none;
  letter-spacing: 0.2px;
}

.kbd-plus {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin: 0 2px;
  user-select: none;
}

body.theme-oled .shortcut-item-row {
  background: #111111 !important;
}

body.theme-oled .kbd-badge {
  background: #181818 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  border-bottom-color: rgba(255, 255, 255, 0.24) !important;
}

/* ==========================================================================
   DYNAMIC SETTINGS THEMES & DENSITY MODIFIERS
   ========================================================================== */
/* OLED Pure Black Theme */
body.theme-oled {
  --bg-main: #000000 !important;
  --bg-sidebar: #070707 !important;
  --bg-card: #0c0c0c !important;
  --bg-input: #0c0c0c !important;
}

body.theme-oled::before {
  display: none !important;
}

body.theme-oled .profile-modal-card,
body.theme-oled .settings-modal-card {
  background: #080808 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.theme-oled .settings-row,
body.theme-oled .profile-user-hero,
body.theme-oled .profile-sub-card,
body.theme-oled .settings-eco-card,
body.theme-oled .settings-about-hero {
  background: #111111 !important;
}

body.theme-oled .new-chat-btn,
body.theme-oled .converter-nav-btn {
  background: #0d0d0d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.theme-oled .new-chat-btn:hover,
body.theme-oled .converter-nav-btn:hover {
  background: #161616 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #ffffff !important;
}

/* Font Size Settings */
body.font-small .user-bubble,
body.font-small .ai-text-bubble,
body.font-small .chat-input {
  font-size: 13px !important;
}

body.font-large .user-bubble,
body.font-large .ai-text-bubble,
body.font-large .chat-input {
  font-size: 16px !important;
}

/* Density Settings */
body.density-compact .msg-row {
  margin-bottom: 8px !important;
}

body.density-compact .user-bubble {
  padding: 8px 14px !important;
}

body.density-compact .ai-card {
  padding: 10px 14px !important;
}

/* Mobile Responsiveness */
@media (max-width: 620px) {
  .settings-modal-card {
    max-width: 95% !important;
    height: auto !important;
    max-height: 85vh !important;
    padding: 16px !important;
  }

  .settings-modal-body {
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: 65vh;
  }

  .settings-nav {
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 0;
    padding-bottom: 8px;
    overflow-x: auto;
  }

  .settings-nav-btn {
    width: auto;
    white-space: nowrap;
    padding: 7px 11px;
    font-size: 12.5px;
  }

  .settings-ecosystem-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   FINVARA AI — TABLES & DOCUMENT CARDS (LIQUID GLASS STYLING)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.finvara-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  color: #e2e8f0;
  white-space: nowrap;
}

.finvara-table thead tr {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.finvara-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
  font-size: 12.5px;
  text-transform: uppercase;
}

.finvara-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.finvara-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.finvara-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.finvara-table tbody tr:last-child td {
  border-bottom: none;
}

/* Light Theme adjustments for tables */
body.theme-light .table-responsive {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.theme-light .finvara-table {
  color: #1e293b;
}

body.theme-light .finvara-table thead tr {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
}

body.theme-light .finvara-table th {
  color: #0f172a;
}

body.theme-light .finvara-table td {
  border-bottom-color: #e2e8f0;
}

body.theme-light .finvara-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

body.theme-light .finvara-table tbody tr:hover {
  background: #f1f5f9;
}

/* File Download Cards */
.finvara-file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  margin: 14px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.finvara-file-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.finvara-file-xlsx {
  border-left: 4px solid #10b981;
}

.finvara-file-docx {
  border-left: 4px solid #3b82f6;
}

.finvara-file-pdf {
  border-left: 4px solid #ef4444;
}

.file-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.file-card-info {
  flex: 1;
  min-width: 0;
}

.file-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.file-card-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.file-card-download-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.file-card-download-btn:active {
  transform: translateY(0);
}

/* Specific button accents */
.finvara-file-xlsx .file-card-download-btn {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.finvara-file-xlsx .file-card-download-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.finvara-file-docx .file-card-download-btn {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}
.finvara-file-docx .file-card-download-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.finvara-file-pdf .file-card-download-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.finvara-file-pdf .file-card-download-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* Light Theme for File Cards */
body.theme-light .finvara-file-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.theme-light .file-card-icon {
  background: #f1f5f9;
}

body.theme-light .file-card-name {
  color: #0f172a;
}

body.theme-light .file-card-meta {
  color: #64748b;
}

/* ==========================================================================
   FINVARA AI — DYNAMIC INTERACTIVE CHART CARDS (LIQUID GLASS STYLING)
   ========================================================================== */
.finvara-chart-card {
  width: 100%;
  max-width: 580px;
  margin: 16px 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 16px 20px;
  box-sizing: border-box;
  animation: chartFadeIn 0.35s ease forwards;
}

@keyframes chartFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chart-card-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

.chart-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.2px;
}

.chart-card-stats-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chart-latest-price {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.chart-unit {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.chart-change-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.chart-change-pill.trend-up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.chart-change-pill.trend-down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chart-svg-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: 4px 0 10px 0;
}

.finvara-svg-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.chart-axis-label {
  font-size: 10px;
  fill: #94a3b8;
  font-family: inherit;
  font-weight: 500;
}

.chart-point-group {
  cursor: pointer;
  outline: none;
}

.chart-point-ring {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
  transition: r 0.2s ease, stroke 0.2s ease;
}

.chart-point-group:hover .chart-point-ring,
.chart-point-group:focus .chart-point-ring {
  r: 9;
  stroke: #ffffff;
}

.chart-point-core {
  transition: r 0.2s ease;
}

.chart-point-group:hover .chart-point-core,
.chart-point-group:focus .chart-point-core {
  r: 4.5;
}

.chart-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.chart-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
}

.chip-label {
  color: #94a3b8;
}

.chip-val {
  color: #e2e8f0;
  font-weight: 600;
}

/* Light Theme for Chart Cards */
body.theme-light .finvara-chart-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

body.theme-light .chart-card-title {
  color: #0f172a;
}

body.theme-light .chart-latest-price {
  color: #0f172a;
}

body.theme-light .chart-grid-line {
  stroke: rgba(0, 0, 0, 0.06);
}

body.theme-light .chart-axis-label {
  fill: #64748b;
}

body.theme-light .chart-card-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .chip-val {
  color: #1e293b;
}

/* ==========================================================================
   CONVERTER & HISTORY SEARCH STYLES
   ========================================================================== */

/* Converter Button in Sidebar */
.converter-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 11px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.converter-nav-btn svg {
  color: #ffffff !important;
  stroke: #ffffff;
  fill: #ffffff;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.converter-nav-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.converter-nav-btn:hover svg {
  color: #ffffff !important;
  stroke: #ffffff;
  fill: #ffffff;
  transform: rotate(180deg);
}

.sidebar.collapsed .converter-nav-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  margin: 0 auto;
}

/* History Search */
.history-search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.history-search-wrapper:focus-within {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.12);
}

.history-search-icon {
  color: #94a3b8;
  flex-shrink: 0;
  margin-right: 8px;
}

.history-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: #f1f5f9;
  font-family: inherit;
  min-width: 0;
}

.history-search-input::placeholder {
  color: #64748b;
}

.history-search-clear {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s;
}

.history-search-clear:hover {
  color: #ffffff;
}

.sidebar.collapsed .history-search-wrapper {
  display: none;
}

/* ==========================================================================
   CONVERTER MODAL (Wide Modern Desktop Layout matching Settings)
   ========================================================================== */
.converter-modal-card {
  background: #181818 !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 26px !important;
  width: 92% !important;
  max-width: 980px !important;
  min-height: 540px !important;
  max-height: 85vh !important;
  padding: 26px 30px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  position: relative;
}

body.theme-oled .converter-modal-card {
  background: #000000 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.converter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
}

.converter-header-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.converter-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.converter-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.converter-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Tabs */
.converter-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px;
  border-radius: 14px;
}

.conv-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conv-tab-btn svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.conv-tab-btn:hover {
  color: #f1f5f9;
}

.conv-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.conv-tab-btn.active svg {
  stroke: #ffffff;
}

/* Panel Layout */
.conv-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Live Rate Banner */
.conv-rate-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 16px;
  border-radius: 12px;
}

.conv-rate-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  flex-shrink: 0;
  animation: pulseRate 2s infinite ease-in-out;
}

@keyframes pulseRate {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.conv-rate-info {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
}

/* Main Grid (Spacious 2 Cards + Swap on Desktop) */
.conv-main-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
  margin-top: 4px;
}

#convPanelCrypto .conv-main-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.conv-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.conv-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.conv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conv-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
}

.conv-field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conv-number-input, .conv-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.conv-number-input:focus, .conv-select:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.conv-select option {
  background: #18191d;
  color: #f8fafc;
}

.conv-result-display {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  color: #34d399;
  font-size: 18px;
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-swap-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.conv-swap-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.conv-swap-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  transform: rotate(180deg) scale(1.08);
}

.conv-card-footer {
  margin-top: 2px;
}

.conv-footer-text {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

/* Presets */
.conv-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.conv-presets-title {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 2px;
}

.conv-preset-btn, .crypto-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.conv-preset-btn:hover, .crypto-preset-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* Crypto Results */
.conv-crypto-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.crypto-change-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.crypto-change-pill.positive {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.crypto-change-pill.negative {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.conv-crypto-results-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  flex: 1;
}

.crypto-res-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.crypto-res-label {
  font-size: 13.5px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.crypto-res-value {
  font-size: 18px;
  font-weight: 700;
  color: #38bdf8;
  text-align: right;
}

.crypto-res-value.highlight {
  color: #34d399;
  font-size: 20px;
}

.crypto-res-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
  .converter-modal-card {
    width: 95% !important;
    padding: 20px 16px !important;
    max-height: 90vh !important;
  }
  .conv-main-grid,
  #convPanelCrypto .conv-main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .conv-swap-center {
    order: 2;
    height: auto;
    padding: 6px 0;
  }
  .conv-swap-btn {
    transform: rotate(90deg);
  }
  .conv-swap-btn:hover {
    transform: rotate(270deg) scale(1.08);
  }
}

