/* css/base.css */
:root {
  color-scheme: dark;
  --bg-main: #080808;
  --bg-sec: #0f0f0f;
  --bg-ter: #161616;
  --text-main: #e0e0e0;
  --text-muted: #888;
  --accent: #a38257;
  --accent-glow: rgba(163, 130, 87, 0.15);
  --danger: #a03030;
  --danger-hover: #c04040;
  --success: #2ea043;
  --border: #1e1e1e;
  --border-light: #2a2a2a;
}

[v-cloak] { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.header {
  background: var(--bg-sec);
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.header-title {
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  flex: 1;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #c2a37d, #8a6632);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-btn {
  background: var(--bg-ter);
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-btn:hover {
  background: var(--border-light);
  color: var(--text-main);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: var(--bg-sec);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.sidebar.open {
  transform: translateX(0);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.new-chat-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.new-chat-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

.chat-item {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  font-size: 14px;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.chat-item:hover {
  background: rgba(255,255,255,0.03);
}

.chat-item.active {
  background: var(--bg-ter);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.chat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  transition: opacity 0.2s;
}

.chat-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  background: var(--bg-sec);
  padding: 0 12px;
  z-index: 2;
  box-shadow: -15px 0 15px var(--bg-sec);
}

.chat-item.active .chat-actions {
  background: var(--bg-ter);
  box-shadow: -15px 0 15px var(--bg-ter);
}

.chat-item.show-actions .chat-actions {
  opacity: 1;
  pointer-events: auto;
}

.action-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.2s;
}

.action-icon-btn.pin-btn { color: var(--accent); }
.action-icon-btn.edit-btn { color: var(--accent); }
.action-icon-btn.delete-btn { color: var(--danger); }

.action-icon-btn:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.05);
}

.settings-bar {
  background: #111;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 5;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.settings-row label {
  font-size: 12px;
  color: var(--text-muted);
  width: 60px;
  font-weight: bold;
  flex-shrink: 0;
}

.settings-row input, .settings-row select {
  flex: 1;
  background: var(--bg-ter);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.settings-row input:focus, .settings-row select:focus {
  border-color: var(--accent);
}

.floating-nav-container {
  position: fixed;
  bottom: 220px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
  transition: opacity 0.4s ease;
}

.floating-nav-container.is-scrolling {
  opacity: 0.3;
}

.nav-float-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a38257, #d4b58c);
  color: #000;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(163, 130, 87, 0.4);
}

.nav-float-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.5);
}

.nav-joystick-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-ter);
  color: var(--accent);
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.nav-joystick-btn:active {
  cursor: grabbing;
}
