@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-message-user: #2d1b69;
  --bg-message-ai: #1a1a2e;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b80;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --border: #2a2a40;
  --sidebar-width: 280px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* ===== App Layout ===== */
#chat-app {
  display: flex;
  height: 100vh;
}

/* ===== Sidebar ===== */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.logo-text-wrap {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.logo-btn:hover {
  opacity: 0.8;
}

.logo-text {
  background: linear-gradient(135deg, var(--accent), #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.new-chat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(167, 139, 250, 0.05);
}

.new-chat-btn span {
  font-size: 1.2rem;
  line-height: 1;
}

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

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chat-item.active {
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent);
}

.chat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Main Area ===== */
#chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative; /* For scroll-to-bottom button positioning */
}

#chat-main.empty-chat {
  justify-content: center;
}

#chat-main.empty-chat #messages-container {
  flex: 0 1 auto;
}

#chat-main.empty-chat #input-area {
  position: static;
  background: transparent;
}

/* ===== User Menu (sidebar bottom) ===== */
.sidebar-footer-item {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  position: relative;
}

.sidebar-user {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

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

.user-menu-dots {
  color: var(--text-muted);
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.user-menu-dropdown {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 8px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-plan-badge {
  color: #f59e0b;
  font-weight: 500;
  cursor: default;
}

.user-plan-free {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Messages ===== */
#messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  /* No scroll-behavior: smooth — it causes flickering on macOS Safari */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translate3d(0, 0, 0); /* GPU acceleration for WebKit */
}

/* Scroll-to-bottom button (like ChatGPT/DeepSeek) */
.scroll-to-bottom {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: opacity 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.scroll-to-bottom.visible {
  display: flex;
}

.message {
  display: flex;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  border-radius: 16px;
  animation: fade-in 0.3s ease;
}

.message-user {
  background: var(--bg-message-user);
}

.message-assistant {
  background: var(--bg-message-ai);
  border: 1px solid var(--border);
}

.message-avatar {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-user .message-avatar {
  background: var(--bg-message-user);
}

.message-assistant .message-avatar {
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.message-content {
  flex: 1;
  line-height: 1.7;
  font-size: 0.95rem;
}

.message-content p {
  margin-bottom: 0.5em;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* ===== Markdown in messages ===== */
.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 1em 0 0.5em;
  color: var(--accent-hover);
}
.message-content h1 { font-size: 1.3rem; }
.message-content h2 { font-size: 1.15rem; }
.message-content h3 { font-size: 1.05rem; }

.message-content ul,
.message-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.message-content li {
  margin-bottom: 0.3em;
}

.message-content strong { color: var(--text-primary); }
.message-content em { color: var(--text-secondary); font-style: italic; }

.message-content code {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Fira Code', monospace;
}

.message-content pre {
  background: #111125;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  margin: 0.8em 0;
}

.message-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
}

.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 0.8em 0;
  color: var(--text-secondary);
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

/* ===== Welcome Screen ===== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 60px 24px;
  position: relative;
  overflow: visible;
}

/* Central soft glow (halo) */
.welcome-screen::before {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 900px;
  max-height: 600px;
  background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.welcome-screen > * {
  position: relative;
  z-index: 1;
}

.welcome-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.welcome-screen h1 {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.15;
  max-width: 540px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--accent), #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.welcome-subtitle {
  max-width: 540px;
  margin-bottom: 72px; /* Large gap to separate info from action */
}

.welcome-subtitle p {
  color: rgba(255, 255, 255, 0.45);
  font-size: clamp(0.9rem, 2.5vw, 0.95rem);
  line-height: 1.5;
  margin-bottom: 8px;
}

.welcome-subtitle p:last-child {
  margin-bottom: 0;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 840px; /* Increased to fit 3 buttons in one line on PC */
  margin: 0 auto;
}

.suggestion {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.suggestion:hover {
  border-color: rgba(167, 139, 250, 0.4);
  color: var(--text-primary);
  background: rgba(167, 139, 250, 0.1);
  transform: translateY(-1px);
}

.welcome-footer {
  margin-top: 20px;
  text-align: center;
  animation: fade-in 0.5s ease;
}

.trust-line {
  margin-bottom: 14px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

#input-area {
  padding: 16px 24px 24px;
  background: var(--bg-primary);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.input-wrapper {
  max-width: 840px; /* Sync with suggestions width */
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 7px 14px;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.input-wrapper.disabled-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
}

.input-wrapper.disabled-wrapper textarea {
  pointer-events: none;
  color: var(--text-muted);
}

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

.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  padding: 6px 4px;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
  outline: none;
}

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

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.stop-btn {
  background: #dc2626;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
  flex-shrink: 0;
  animation: pulse-stop 1.5s ease-in-out infinite;
}

.stop-btn:hover {
  background: #ef4444;
  transform: scale(1.05);
}

@keyframes pulse-stop {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Typing indicator ===== */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ===== Animations ===== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Mobile Header (hidden on desktop) ===== */
#mobile-header {
  display: none;
}

#sidebar-overlay {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* Mobile header */
  #mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .burger-btn,
  .mobile-new-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .burger-btn:hover,
  .mobile-new-btn:hover {
    color: var(--accent);
    background: rgba(167, 139, 250, 0.1);
  }

  .mobile-logo {
    font-size: 1.1rem;
    font-weight: 600;
  }

  /* Sidebar as slide-in drawer */
  #sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  /* Overlay behind sidebar */
  #sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

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

  /* Chat app layout */
  #chat-app {
    flex-direction: column;
    height: 100%;
  }

  #chat-main {
    flex: 1;
    min-height: 0;
  }

  /* Messages & input adjustments */
  .message {
    padding: 10px 12px;
    flex-direction: column;
    gap: 6px;
  }
  .message-avatar {
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
  .message-content {
    font-size: 0.9rem;
  }
  #input-area { padding: 8px 12px 12px; }

  /* Shorter placeholder on mobile */
  .input-wrapper textarea::placeholder {
    font-size: 0.88rem;
  }
  .input-wrapper textarea {
    max-height: 120px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  /* Welcome screen adjustments */
  .welcome-screen h1 { font-size: 1.5rem; }
  .suggestions { flex-direction: column; align-items: center; }
  .suggestion { width: 100%; text-align: center; }
}

/* ===== Limit Banner ===== */
#limit-banner {
  padding: 0 24px;
  max-width: 800px;
  margin: 0 auto;
}

.limit-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 12px;
  margin-bottom: 8px;
  animation: fade-in 0.3s ease;
}

.limit-banner-text {
  flex: 1;
  font-size: 0.85rem;
  color: #fbbf24;
  line-height: 1.4;
}

.limit-banner-timer {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fb923c;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: center;
}

.limit-banner-action {
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--accent-hover);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.limit-banner-action:hover {
  background: rgba(167, 139, 250, 0.3);
  border-color: var(--accent);
}

/* ===== Modal Overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.3s ease;
}

.modal-card {
  background: linear-gradient(145deg, #1e1538, #151025);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(167, 139, 250, 0.1);
  animation: modal-slide-up 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-form {
  text-align: left;
}

.modal-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: -4px;
}

.profile-form .modal-label {
  display: block;
  margin-bottom: 6px;
  margin-top: 4px;
}

.modal-input {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--accent);
}

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

/* Date input fix for dark theme */
.modal-input[type="date"] {
  color-scheme: dark;
}

.modal-btn {
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.modal-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.modal-price {
  margin: 16px 0;
  padding: 16px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.price-amount {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.price-period {
  font-size: 1rem;
  color: var(--text-secondary);
}

.modal-features {
  list-style: none;
  text-align: left;
  margin: 20px 0;
  padding: 0;
}

.modal-features li {
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-features li:last-child {
  border-bottom: none;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  padding: 16px 24px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(167, 139, 250, 0.15);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
  animation: cookie-slide-up 0.4s ease;
}

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cookie-banner-text {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cookie-banner-text a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.cookie-banner-text a:hover {
  color: var(--accent-hover);
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn-accept {
  padding: 10px 24px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.cookie-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.cookie-btn-settings {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Cookie Settings Modal */
.cookie-settings-card {
  text-align: left;
}

.cookie-settings-card h2 {
  text-align: center;
}

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cookie-option:last-child {
  border-bottom: none;
}

.cookie-option-info {
  flex: 1;
}

.cookie-option-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cookie-option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 16px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--accent);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.5;
  cursor: default;
}

.cookie-settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cookie-settings-actions .modal-btn {
  flex: 1;
}

@keyframes cookie-slide-up {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .modal-card { padding: 32px 24px; }
  .modal-title { font-size: 1.2rem; }
  #limit-banner { padding: 0 12px; }

  .cookie-banner-inner {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-btn-accept,
  .cookie-btn-settings {
    flex: 1;
  }
}

.mobile-logo, .sidebar-logo-link {
  text-decoration: none !important;
}
