/* ========================================================================
LIVE CHAT WIDGET - CROSS-CULTURAL DESIGN SYSTEM
Target: RO / DACH / EN | Psychological: Trust + Clarity + Micro-reward
======================================================================== */
/* 1. VARIABLES & THEME =================================================== */
:root {
  /* Colors */
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-surface: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --warm: #D97706;
  --success: #10B981;
  --error: #EF4444;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.12);
  --focus-ring: 0 0 0 3px rgba(37,99,235,0.25);
  /* Chat-specific */
  --chat-primary: #2563EB;
  --chat-user-bg: #2563EB;
  --chat-user-text: #FFFFFF;
  --chat-operator-bg: #E2E8F0;
  --chat-operator-text: #1E293B;
  --chat-header-bg: #2563EB;
  --chat-header-text: #FFFFFF;
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 64px;
  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  --text-base: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
  --text-lg: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.25rem);
  /* Motion */
  --ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0B1120;
    --bg-card: #111827;
    --bg-surface: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  }
}
html.theme-dark {
  --bg-page: #0B1120;
  --bg-card: #111827;
  --bg-surface: #1E293B;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --chat-operator-bg: #334155;
  --chat-operator-text: #F1F5F9;
}

/* Shimmer effect for loading states */
.shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
html.theme-dark .shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  background-size: 200% 100%;
}

/* Badge pulse animation */
.badge-pulse {
  animation: pulse 2s infinite;
}
/* 2. BASE & RESET ======================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
ul, ol { list-style: none; }
/* 3. LAYOUT & CONTAINERS ================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: var(--space-lg);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-size: var(--text-lg);
  line-height: 1.2;
  transition: opacity var(--ease);
}
.logo:hover {
  opacity: 0.9;
}
.logo-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  border-radius: var(--radius-sm);
}
.logo strong {
  font-weight: 700;
  letter-spacing: -0.02em;
}
main { flex: 1; padding-block: var(--space-2xl); }
footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
/* 4. TYPOGRAPHY & UTILITIES ============================================= */
h1, h2, h3, h4 {
  text-wrap: balance;
  line-height: 1.2;
  font-weight: 600;
}
h1 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--text-xl); }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
/* Screen Reader Only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* 5. COMPONENTS ========================================================= */
/* Language Switcher - Pill Design */
.lang-switch {
  display: inline-flex;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
  align-items: center;
  width: auto;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.lang-btn:hover {
  color: var(--text-primary);
}
.lang-btn[aria-current="true"] {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}
/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: grid; place-items: center;
  font-size: 1.1rem;
}
/* Hero Section */
.hero {
  text-align: center;
  padding-block: var(--space-2xl);
}
.hero p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 650px;
  margin: var(--space-sm) auto var(--space-xl);
}
/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--ease-slow);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  contain: layout style;
}
@media (hover: hover) {
  .tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
  }
}
.tool-card h3 {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.3;
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  object-fit: contain;
}
.tool-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card .btn {
  margin-top: auto;
}
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  transition: var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn--outline:hover { background: var(--bg-surface); }
.btn--small {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
}
.btn--success {
  background: var(--success);
  color: #fff;
}
.btn--success:hover {
  background: #059669;
}
/* Forms */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}
.form-input, .form-textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: var(--ease);
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}
.form-input.is-error, .form-textarea.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.form-help { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-xs); }
/* ========================================================================
LIVE CHAT WIDGET STYLES
======================================================================== */
/* Floating Chat Button */
.chat-widget-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}
.chat-widget-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.chat-widget-fab svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
.chat-widget-fab.has-unread {
  animation: pulse 2s infinite;
}
.chat-widget-fab .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9991;
  width: 380px;
  height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity var(--ease), visibility var(--ease), transform var(--ease);
}
.chat-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.chat-window-header {
  background: var(--chat-header-bg);
  color: var(--chat-header-text);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.chat-window-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--chat-header-text);
}
.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
}
.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
}
.chat-status-dot.offline {
  background: #94A3B8;
}
.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--chat-header-text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--ease);
}
.chat-close-btn:hover {
  background: rgba(255,255,255,0.15);
}
.chat-close-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--bg-surface);
}
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message.user {
  align-self: flex-end;
}
.chat-message.operator {
  align-self: flex-start;
}
.chat-message-content {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  line-height: 1.4;
}
.chat-message.user .chat-message-content {
  background: var(--chat-user-bg);
  color: var(--chat-user-text);
  border-bottom-right-radius: 4px;
}
.chat-message.operator .chat-message-content {
  background: var(--chat-operator-bg);
  color: var(--chat-operator-text);
  border-bottom-left-radius: 4px;
}
.chat-message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}
.chat-message.user .chat-message-time {
  text-align: right;
}
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-xl);
}
.chat-empty-state svg {
  width: 48px;
  height: 48px;
  fill: var(--text-muted);
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.chat-empty-state p {
  font-size: var(--text-sm);
}

/* Chat Input Area */
.chat-input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  resize: none;
  min-height: 44px;
  max-height: 100px;
  font-family: inherit;
  transition: var(--ease);
}
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.chat-input::placeholder {
  color: var(--text-muted);
}
.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--chat-primary);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--ease);
  flex-shrink: 0;
}
.chat-send-btn:hover {
  background: var(--accent-hover);
}
.chat-send-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}
.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.chat-error-message {
  padding: var(--space-xs) var(--space-sm);
  background: rgba(239,68,68,0.1);
  color: var(--error);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  display: none;
}
.chat-error-message.is-visible {
  display: block;
}

/* Typing indicator */
.chat-typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: var(--space-xs) var(--space-sm);
  background: var(--chat-operator-bg);
  border-radius: var(--radius-sm);
  align-self: flex-start;
}
.chat-typing-indicator.is-visible {
  display: flex;
}
.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(1); }
  40% { transform: scale(1.3); }
}

/* Connection status */
.chat-connection-status {
  padding: 4px 8px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-surface);
}
.chat-connection-status.disconnected {
  color: var(--error);
  background: rgba(239,68,68,0.1);
}

/* ========================================================================
CHAT INFO SECTION (in main content)
======================================================================== */
.chat-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  max-width: 700px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.chat-info-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}
.chat-feature {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.chat-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
}
.chat-feature-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--accent);
}
.chat-feature h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
}
.chat-feature p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin: 0;
}

/* ========================================================================
ADMIN PANEL STYLES
======================================================================== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.admin-title {
  font-size: var(--text-2xl);
  font-weight: 700;
}
.admin-logout-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--ease);
}
.admin-logout-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}
.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-xl);
  min-height: 600px;
}
.admin-sessions-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-sessions-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: var(--text-sm);
}
.admin-session-item {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--ease);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-session-item:hover {
  background: var(--bg-surface);
}
.admin-session-item.active {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
}
.admin-session-item.has-unread {
  background: rgba(37,99,235,0.05);
}
.admin-session-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.admin-session-preview {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-session-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.admin-session-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.admin-session-status .dot.active {
  background: var(--success);
}
.admin-session-status .dot.resolved {
  background: var(--text-muted);
}
.admin-empty-sessions {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.admin-chat-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-chat-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-chat-header h3 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
}
.admin-chat-actions {
  display: flex;
  gap: var(--space-sm);
}
.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--bg-surface);
}
.admin-chat-input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
}
.admin-chat-input {
  flex: 1;
}
.admin-no-session {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.admin-login-form {
  max-width: 400px;
  margin: var(--space-2xl) auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}
.admin-login-form h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.admin-error {
  padding: var(--space-sm) var(--space-md);
  background: rgba(239,68,68,0.1);
  color: var(--error);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  display: none;
}
.admin-error.is-visible {
  display: block;
}
.admin-notification {
  position: fixed;
  top: 80px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 9992;
  display: none;
  animation: slideInRight 0.3s ease;
}
.admin-notification.is-visible {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.admin-notification-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ========================================================================
MODERN FOOTER
======================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 2rem));
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.35), transparent);
}
.footer-grid-modern {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 320px;
}
.footer-logo {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.footer-tagline {
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
}
.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.footer-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}
.footer-links a:hover {
  color: var(--accent);
  transform: translateX(2px);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}
.footer-bottom-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* 6. STATES & ANIMATIONS ================================================ */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
.loading .tool-card {
  background: linear-gradient(90deg, var(--bg-surface) 25%, #e2e8f0 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-color: transparent;
}
@media (prefers-color-scheme: dark) {
  .loading .tool-card {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
  }
}
/* Focus Accessibility */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
/* 7. RESPONSIVE ========================================================= */
@media (max-width: 640px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
  }
  .tool-grid { grid-template-columns: 1fr; }
  .cta-box form { flex-direction: column; }
  .lang-btn span { display: none; }
  .lang-btn { padding: 6px 8px; font-size: 1.2rem; }
  .chat-window {
    width: calc(100vw - 32px);
    max-width: 320px;
    height: calc(100vh - 150px);
    bottom: 90px;
    right: 16px;
    left: 16px;
  }
  .chat-widget-fab {
    bottom: 16px;
    right: 16px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-container {
    padding: var(--space-md);
  }
}
@media (max-width: 900px) {
  .footer-grid-modern {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }
  .footer-brand {
    align-items: center;
  }
  .footer-column {
    align-items: center;
  }
  .footer-links {
    align-items: center;
  }
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
}
@media (max-width: 640px) {
  .footer-links a:hover {
    transform: none;
  }
}
/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Print */
@media print {
  .site-header, .tools-count-banner, .btn, .theme-toggle, .lang-switch, footer { display: none; }
  .chat-widget-fab, .chat-window { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card { break-inside: avoid; box-shadow: none; border: 1px solid #000; }
}
/* ========================================================================
STICKY DONATION BUTTON (Ethical UX)
======================================================================== */
.sticky-donate-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--ease), transform var(--ease);
  pointer-events: none;
}
.sticky-donate-wrapper.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sticky-donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FFDD00;
  color: #111;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  border: none;
  text-decoration: none;
  transition: transform var(--ease), box-shadow var(--ease);
}
.sticky-donate-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 16px rgba(255, 205, 0, 0.3);
}
.sticky-donate-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.donate-icon { font-size: 1.2em; }
.sticky-donate-dismiss {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--ease);
  align-self: flex-end;
}
@media (max-width: 640px) {
  .sticky-donate-wrapper { bottom: 16px; right: 16px; }
  .sticky-donate-btn { padding: 8px 14px; font-size: var(--text-xs); border-radius: 999px; }
  .sticky-donate-btn .donate-text { display: inline-flex !important; }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-donate-wrapper, .sticky-donate-btn {
    transition: none !important;
    animation: none !important;
  }
}
#pwaInstallBtn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  gap: 6px;
}
#pwaInstallBtn:hover {
  background: var(--bg-surface);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  #pwaInstallBtn {
    bottom: 80px;
    left: 16px;
    padding: 6px 12px;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}
.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.modal-close:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.modal-content {
  padding: var(--space-2xl);
  overflow-y: auto;
  max-height: 80vh;
}
.modal-content .modal-title {
  margin-top: 0;
  margin-bottom: var(--space-lg);
  font-size: var(--text-2xl);
  color: var(--text-primary);
}
.modal-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}