/* ========================================
   HAIR CARE ASSISTANT - MODERN STYLING - Blue
   Version: 3.0 - Floating Widget Edition
   ======================================== */

/* Import Inter Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES - LIGHT & DARK THEMES
   ======================================== */

:root {
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */

  /* Spacing Scale (modular scale 1.2) */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */

  /* Border Radius - Enhanced for Glassmorphism */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-3xl: 32px;
  --radius-full: 9999px;

  /* Shadows - Softer for Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 32px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
  --shadow-2xl: 0 24px 48px -12px rgba(0, 0, 0, 0.18);
  --shadow-cyan: 0 8px 24px -4px rgba(6, 182, 212, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal: 9000;
  --z-toast: 9500;
  --z-tooltip: 9999;
}

/* Light Theme (Default) */
:root,
[data-theme="light"] {
  /* Primary Colors - Chatizz Cyan */
  --primary-50: #ecfeff;
  --primary-100: #cffafe;
  --primary-200: #a5f3fc;
  --primary-300: #67e8f9;
  --primary-400: #22d3ee;
  --primary-500: #06b6d4;
  --primary-600: #0891b2;
  --primary-700: #0e7490;
  --primary-800: #155e75;
  --primary-900: #164e63;

  /* Accent Colors - Chatizz Rose */
  --accent-50: #fff1f2;
  --accent-100: #ffe4e6;
  --accent-200: #fecdd3;
  --accent-300: #fda4af;
  --accent-400: #fb7185;
  --accent-500: #f43f5e;
  --accent-600: #e11d48;
  --accent-700: #be123c;

  /* Neutrals - Chatizz Slate */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* Semantic Colors - Chatizz Slate Based */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-bg-elevated: #ffffff;

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-inverse: #ffffff;

  --color-border-light: #f1f5f9;
  --color-border-medium: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-surface-hover: rgba(6, 182, 212, 0.04);
  --color-surface-active: rgba(6, 182, 212, 0.08);

  /* Gradients - Chatizz Cyan/Rose */
  --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  --gradient-accent: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
  --gradient-bot-message: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --gradient-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);

  /* Button and Header Gradients */
  --button-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --header-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);

  /* Glassmorphism - Enhanced */
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.15);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--gradient-bg);
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
}

/* ========================================
   FLOATING BUBBLE BUTTON
   ======================================== */

.chat-bubble-button {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  display: none; /* DODANE - ukrywa przycisk bubble */
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  z-index: var(--z-fixed);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  overflow: hidden;
}

.chat-bubble-button:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-2xl);
}

.chat-bubble-button:active {
  transform: scale(0.95);
}

.chat-bubble-button .bubble-icon,
.chat-bubble-button .close-icon {
  position: absolute;
  width: 28px;
  height: 28px;
  color: var(--color-text-inverse);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.chat-bubble-button .bubble-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.chat-bubble-button .close-icon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

.chat-bubble-button.active .bubble-icon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}

.chat-bubble-button.active .close-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.chat-bubble-button .bubble-emoji {
  position: absolute;
  font-size: 32px;
  transition: transform var(--transition-base), opacity var(--transition-base);
  pointer-events: none;
  opacity: 0;
}

.chat-bubble-button:not(.active) .bubble-emoji {
  animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.05);
  }
}

/* Pulse animation when closed */
.chat-bubble-button:not(.active)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  opacity: 0.6;
  animation: pulseBubble 2s ease-in-out infinite;
  pointer-events: none;
}

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

/* Mobile positioning */
@media (max-width: 768px) {
  .chat-bubble-button {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 56px;
    height: 56px;
  }

  .chat-bubble-button .bubble-icon,
  .chat-bubble-button .close-icon {
    width: 24px;
    height: 24px;
  }

  .chat-bubble-button .bubble-emoji {
    font-size: 28px;
  }
}

/* ========================================
   CHAT WIDGET CONTAINER
   ======================================== */

.chat-widget {
  position: fixed;
  top: 0;                /* ZMIANA: wypełnienie 100% iframe */
  left: 0;               /* ZMIANA: wypełnienie 100% iframe */
  right: 0;              /* DODANE: wypełnienie 100% iframe */
  bottom: 0;             /* DODANE: wypełnienie 100% iframe */
  width: 100%;           /* ZMIANA: z 420px na 100% */
  max-width: 100%;       /* ZMIANA: z calc() na 100% */
  height: 100%;          /* ZMIANA: z 650px na 100% */
  max-height: 100%;      /* ZMIANA: z calc() na 100% */
  transform: none;       /* ZMIANA: brak transformacji (z translate(-50%, -50%)) */
  z-index: var(--z-fixed);

  /* Widget zawsze widoczny - usunięte: opacity, visibility, transform animations */
}

/* USUNIĘTE - widget zawsze widoczny, klasa .active niepotrzebna
.chat-widget.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
*/

/* Mobile: fullscreen */
@media (max-width: 768px) {
  .chat-widget {
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    transform: none; /* ZMIANA: brak animacji, widget zawsze widoczny */
  }

  /* USUNIĘTE: .chat-widget.active - niepotrzebne
  .chat-widget.active {
    transform: translateY(0);
  }
  */
}

/* ========================================
   CHAT CONTAINER (Main Card)
   ======================================== */

.chat-container {
  width: 100%;
  height: 100%;
  border-radius: 0;           /* ZMIANA: brak zaokrąglenia - iframe będzie ramką */
  box-shadow: none;           /* ZMIANA: brak cienia */
  background: #ffffff;        /* ZMIANA: solidny biały zamiast glassmorphism */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* USUNIĘTE: backdrop-filter: blur(20px); */
  /* USUNIĘTE: -webkit-backdrop-filter: blur(20px); */
  border: none;               /* ZMIANA: brak ramki */
}

@media (max-width: 768px) {
  .chat-container {
    border-radius: 0;
    border: none;
    box-shadow: none;              /* DODANE: usunięcie cienia na mobile */
    backdrop-filter: none;         /* DODANE: usunięcie blur efektu na mobile */
    -webkit-backdrop-filter: none; /* DODANE: usunięcie blur efektu na mobile (Safari) */
  }
}

/* ========================================
   CHAT HEADER
   ======================================== */

.chat-header {
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-status {
  font-size: var(--font-size-xs);
  opacity: 0.9;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Minimize Button */
.minimize-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: none; /* DODANE - ukrywa przycisk minimize */
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.minimize-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.minimize-button svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-inverse);
  transition: transform var(--transition-base);
}

.minimize-button:hover svg {
  transform: translateY(2px);
}

/* ========================================
   CHAT BODY
   ======================================== */

.chat-body {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
  background: var(--color-bg-secondary);
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Custom scrollbar */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--gradient-bot-message);
  border-radius: var(--radius-xl);
  max-width: fit-content;
  box-shadow: var(--shadow-sm);
  animation: slideInMessage 0.3s ease-out;
}

.typing-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-400);
  animation: typingDots 1.4s infinite ease-in-out both;
}

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

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

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

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

/* ========================================
   MESSAGE BUBBLES
   ======================================== */

.chat-bubble {
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  max-width: 85%;
  word-wrap: break-word;
  line-height: 1.6;
  font-size: var(--font-size-sm);
  animation: slideInMessage 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.chat-bubble:hover {
  transform: translateY(-1px);
}

@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bot-message {
  background: rgba(248, 250, 252, 0.9);
  color: var(--color-text-primary);
  align-self: flex-start;
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-left: 0;
  margin-right: auto;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bot-message:hover {
  box-shadow: var(--shadow-md);
  background: rgba(248, 250, 252, 1);
}

.bot-message strong {
  color: var(--primary-600);
  font-weight: 600;
}

/* Markdown styling */
.bot-message > :first-child { margin-top: 0; }
.bot-message > :last-child { margin-bottom: 0; }

/* Headings in bot messages */
.bot-message h1,
.bot-message h2,
.bot-message h3,
.bot-message h4,
.bot-message h5,
.bot-message h6 {
  margin: var(--space-lg) 0 var(--space-sm);
  line-height: 1.5;
  color: var(--primary-600);
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.bot-message h1:first-child,
.bot-message h2:first-child,
.bot-message h3:first-child,
.bot-message h4:first-child {
  margin-top: 0;
}

.bot-message h1 {
  font-size: var(--font-size-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border-light);
  width: 100%;
}

.bot-message h2 {
  font-size: var(--font-size-lg);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
  width: 100%;
}

.bot-message h3 {
  font-size: var(--font-size-base);
  margin-top: var(--space-md);
  color: var(--primary-600);
}

.bot-message h4 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
}

/* Paragraphs */
.bot-message p {
  margin: var(--space-sm) 0;
  color: var(--color-text-primary);
  line-height: 1.6;
}

/* Lists */
.bot-message ul,
.bot-message ol {
  margin: var(--space-sm) 0;
  padding-left: 0;
  list-style-position: outside;
}

.bot-message ul {
  list-style-type: none;
}

.bot-message ul li {
  position: relative;
  padding-left: var(--space-lg);
  margin: var(--space-sm) 0;
  color: var(--color-text-primary);
  line-height: 1.6;
}

.bot-message ul li::before {
  content: '•';
  position: absolute;
  left: var(--space-xs);
  color: var(--primary-500);
  font-weight: 700;
  font-size: 1.2em;
}

.bot-message ol {
  counter-reset: list-counter;
  padding-left: var(--space-lg);
}

.bot-message ol li {
  counter-increment: list-counter;
  position: relative;
  margin: var(--space-sm) 0;
  color: var(--color-text-primary);
  line-height: 1.6;
  padding-left: var(--space-xs);
}

.bot-message ol li::marker {
  color: var(--primary-500);
  font-weight: 600;
}

/* Nested lists */
.bot-message ul ul,
.bot-message ol ul,
.bot-message ul ol,
.bot-message ol ol {
  margin: var(--space-xs) 0;
  padding-left: var(--space-lg);
}

.bot-message a {
  color: var(--primary-600);
  text-decoration: underline;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.bot-message a:hover {
  color: var(--accent-500);
}

.bot-message code {
  background: var(--color-surface-hover);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-size: var(--font-size-xs);
  color: var(--primary-600);
  border: 1px solid var(--color-border-medium);
}

/* Blockquote */
.bot-message blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  padding-left: var(--space-lg);
  border-left: 3px solid var(--primary-400);
  background: var(--color-surface-hover);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Horizontal rule */
.bot-message hr {
  margin: var(--space-lg) 0;
  border: none;
  border-top: 1px solid var(--color-border-light);
}

/* Better spacing for sections with emoji headers */
.bot-message h2:has(+ p),
.bot-message h3:has(+ p),
.bot-message h4:has(+ p) {
  margin-bottom: var(--space-sm);
}

/* Product/Section cards styling - listy po nagłówkach */
.bot-message h3 + ul,
.bot-message h4 + ul {
  background: var(--color-bg-tertiary);
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
  border-left: 3px solid var(--primary-400);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bot-message h3 + ul li,
.bot-message h4 + ul li {
  margin: var(--space-xs) 0;
  line-height: 1.6;
}

/* Numbered lists styling (for Krok 1:, Krok 2:, etc.) */
.bot-message > p + h3,
.bot-message > p + h4 {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

/* Tight spacing for product details */
.bot-message ul + h3,
.bot-message ul + h4 {
  margin-top: var(--space-xl);
}

/* Better visual separation between major sections */
.bot-message > h2 {
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
}

.bot-message > h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

.bot-message > h3:first-child,
.bot-message > h4:first-child {
  margin-top: 0;
}

/* Special styling for "Ważne" / "Note" sections */
.bot-message h2:has(+ ul),
.bot-message h3:has(+ ul),
.bot-message h4:has(+ ul) {
  margin-bottom: var(--space-xs);
}

.user-message {
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  align-self: flex-end;
  margin-right: 0;
  margin-left: auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}

.user-message:hover {
  box-shadow: var(--shadow-md);
}

/* ========================================
   OPTIONS / BUTTONS
   ======================================== */

.options-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: fit-content;
  animation: slideInMessage 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.button-option {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--color-border-medium);
  color: var(--color-text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.button-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
  border-radius: var(--radius-xl);
}

.button-option:hover::before {
  opacity: 1;
}

.button-option:hover {
  color: var(--color-text-inverse);
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.button-option > * {
  position: relative;
  z-index: 1;
}

.button-option:active {
  transform: translateY(0);
}

.button-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button-option:disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Follow-up buttons - lighter style */
.button-option.followup {
  background: transparent;
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  font-weight: 400;
  box-shadow: none;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
}

.button-option.followup::before {
  background: var(--color-surface-hover);
}

.button-option.followup:hover {
  background: var(--color-surface-hover);
  border-color: var(--primary-500);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.button-option.followup:hover::before {
  opacity: 0;
}

/* Recommended badge */
.button-option.recommended {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.button-option.recommended::after {
  content: "⭐ POLECANE";
  position: relative;
  z-index: 2;
  margin-left: var(--space-xs);
  font-size: var(--font-size-xs);
  padding: 4px var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-text-inverse);
  background: var(--color-text-inverse);
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Badge styling when button is hovered */
.button-option.recommended:hover::after {
  color: var(--primary-600);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

/* ========================================
   LOADING INDICATOR
   ======================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.6);
  flex-direction: column;
  animation: slideInMessage 0.3s ease-out;
}

.loading p {
  color: var(--color-text-secondary);
  font-weight: 500;
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-sm);
  text-align: center;
}

/* Płynne przejścia dla dynamicznych wiadomości */
.loading-message {
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin: 0;
  font-size: var(--font-size-sm);
  text-align: center;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-500);
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--primary-400);
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--accent-500);
}

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

.cancel-loading-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--accent-500);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  margin-top: var(--space-xs);
  transition: all var(--transition-base);
  opacity: 0;
  transform: translateY(10px);
}

.cancel-loading-btn:hover {
  background: var(--gradient-accent);
  color: var(--color-text-inverse);
  border-color: transparent;
  transform: translateY(0) scale(1.02);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* ========================================
   CHAT FOOTER (Input Area)
   ======================================== */

.chat-footer {
  display: flex;
  padding: var(--space-lg);
  padding-bottom: var(--space-sm);
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border-light);
  gap: var(--space-sm);
  align-items: center;
}

#user-input {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid rgba(226, 232, 240, 0.6);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-family: var(--font-primary);
  outline: none;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-text-primary);
  line-height: 1.5;
}

#user-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
  background: rgba(255, 255, 255, 1);
}

#user-input::placeholder {
  color: var(--color-text-tertiary);
}

#send-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--color-text-inverse);
  border: none;
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

#send-button:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}

#send-button:active:not(:disabled) {
  transform: scale(0.95);
}

#send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: scale(1);
}

.button-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-text-inverse);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========================================
   CHAT BRANDING FOOTER
   ======================================== */

.chat-branding {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-xs) var(--space-lg);
  padding-bottom: var(--space-sm);
  background: var(--color-bg-primary);
}

.chat-branding p {
  margin: 0;
  font-size: 10px;
  color: #A0A0A0;
  font-weight: 400;
  text-align: center;
  line-height: 1.4;
}

.chat-branding a {
  color: #A0A0A0;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.chat-branding a:hover {
  color: var(--primary-500);
  text-decoration: none;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chat-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .chat-header {
    padding: 14px 18px;
    min-height: 56px;
  }
  
  .chat-header h3 {
    font-size: 17px;
  }
  
  .chat-body {
    padding: 16px;
  }
  
  .chat-bubble {
    max-width: 90%;
    padding: 12px 14px;
  }
  
  .button-option {
    padding: 12px 16px;
    font-size: 14px;
  }
}

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

/* Modal Overlay */
/* ====================
   IMAGE UPLOAD MODAL - Chatizz Design System
   ==================== */

.image-upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-upload-modal.active {
  display: flex;
}

.image-upload-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.image-upload-container {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 32px;
  box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Modal Header - Transparent with separator */
.image-upload-header {
  background: transparent;
  color: var(--color-text-primary);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-upload-header h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
}

.header-icon {
  width: 24px;
  height: 24px;
  stroke: var(--primary-500);
  color: var(--primary-500);
  flex-shrink: 0;
}

.close-upload-modal {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.close-upload-modal:hover {
  opacity: 1;
  background: var(--color-surface-hover);
}

.close-upload-modal svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* Modal Body */
.image-upload-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Drag & Drop Zone */
.drag-drop-zone {
  border: 2px solid var(--color-border-medium);
  border-radius: 20px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.drag-drop-zone:hover {
  border-color: var(--primary-500);
  background: rgba(6, 182, 212, 0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.drag-drop-zone.drag-over {
  border-color: var(--primary-500);
  background: var(--color-surface-active);
  transform: scale(1.01);
}

.drag-drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  animation: floatIcon 3s ease-in-out infinite;
  color: var(--primary-500);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.drag-drop-zone h4 {
  margin: 0 0 8px 0;
  color: var(--color-text-primary);
  font-size: 18px;
  font-weight: 600;
}

.drag-drop-subtitle {
  color: var(--color-text-tertiary);
  font-size: 15px;
  margin: 0 0 20px 0;
  font-weight: 500;
}

.supported-formats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.format-badge {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--color-border-medium);
  color: var(--primary-600);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.format-separator {
  color: var(--color-border-medium);
  font-weight: 600;
}

.max-size {
  color: var(--color-text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

/* Upload Options */
.upload-options {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px 0;
  justify-content: center;
}

.upload-option-btn {
  flex: 1;
  max-width: 180px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--color-border-medium);
  color: var(--color-text-primary);
  padding: 20px 24px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.upload-option-btn:hover {
  border-color: var(--primary-500);
  background: var(--color-surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-cyan);
}

.upload-option-btn.primary {
  background: var(--button-gradient);
  border-color: var(--primary-500);
  color: white;
  box-shadow: var(--shadow-lg);
}

.upload-option-btn.primary:hover {
  box-shadow: 0 12px 24px rgba(6, 182, 212, 0.25);
  transform: translateY(-3px);
}

.option-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-500);
}

.upload-option-btn.primary .option-icon {
  color: white;
}

.option-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.option-label {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
}

.or-divider {
  margin: 16px 0;
  color: var(--color-text-tertiary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  text-align: center;
}

.or-divider span {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 16px;
  position: relative;
  z-index: 1;
  border-radius: 12px;
}

.or-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--color-border-light);
  opacity: 0.5;
}

/* Camera View */
.camera-view-container {
  display: none;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.camera-preview {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#camera-canvas {
  display: none;
}

.camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.camera-control-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.camera-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.camera-control-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

.camera-control-btn.secondary {
  width: 48px;
  height: 48px;
}

.camera-control-btn.secondary svg {
  width: 20px;
  height: 20px;
}

.camera-control-btn.capture {
  width: 72px;
  height: 72px;
  background: white;
  border: 4px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.camera-control-btn.capture:hover {
  transform: scale(1.05);
}

.camera-control-btn.capture:active {
  transform: scale(0.95);
}

.capture-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--primary-500);
  animation: captureRingPulse 2s ease-in-out infinite;
}

@keyframes captureRingPulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 1;
  }
  50% {
    transform: scale(1);
    opacity: 0.7;
  }
}

.capture-inner {
  width: 48px;
  height: 48px;
  background: var(--button-gradient);
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

/* Photo Gallery */
.photo-gallery {
  animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-label {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.gallery-thumbnail {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--color-border-light);
  transition: all 0.3s ease;
}

.gallery-thumbnail:hover {
  transform: scale(1.05);
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

.gallery-thumbnail.selected {
  border-color: var(--primary-500);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

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

.thumbnail-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: var(--primary-500);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.gallery-thumbnail.selected .thumbnail-check {
  display: flex;
}

.gallery-actions {
  display: flex;
  gap: 12px;
}

.gallery-action-btn {
  flex: 1;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gallery-action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}

.gallery-action-btn.primary {
  background: var(--button-gradient);
  color: white;
}

.gallery-action-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gallery-action-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gallery-action-btn.secondary {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--color-border-medium);
  color: var(--color-text-primary);
}

.gallery-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary-500);
  color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Camera Permission Prompt */
.camera-permission-prompt {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInScale 0.3s ease-out;
}

.permission-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--accent-500);
  opacity: 0.8;
}

.permission-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
}

.camera-permission-prompt h4 {
  color: var(--color-text-primary);
  font-size: 18px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.camera-permission-prompt p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.permission-retry-btn,
.permission-cancel-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--color-border-medium);
  color: var(--primary-600);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 6px;
}

.permission-retry-btn:hover {
  background: var(--button-gradient);
  color: white;
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.permission-cancel-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

/* Image Preview */
.image-preview-container {
  text-align: center;
  animation: fadeInScale 0.3s ease-out;
}

.preview-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

#preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
  border: 2px solid var(--color-border-medium);
}

.remove-image-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-500);
  border: 2px solid white;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
  transition: all 0.2s ease;
  padding: 0;
}

.remove-image-btn:hover {
  background: var(--accent-600);
  transform: scale(1.1) rotate(90deg);
}

.remove-image-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Compression Info */
.compression-info {
  margin-bottom: 16px;
}

.compression-badge {
  display: inline-block;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--primary-700);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* Upload Button */
.upload-image-btn {
  background: var(--button-gradient);
  color: white;
  border: none;
  padding: 18px 36px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  min-width: 240px;
}

.upload-image-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(6, 182, 212, 0.3);
}

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

.btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
}

.btn-text {
  white-space: nowrap;
  font-size: 17px;
}

/* Upload Progress */
.upload-progress-container {
  text-align: center;
  padding: 20px;
}

.progress-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.progress-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--color-border-light);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.progress-text {
  color: var(--color-text-secondary);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--button-gradient);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progressPulse 1.5s ease-in-out infinite;
}

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

/* Upload Error */
.upload-error-container {
  text-align: center;
  padding: 20px;
  animation: shakeError 0.5s ease-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--accent-500);
}

.error-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
}

.error-message {
  color: var(--color-text-primary);
  font-size: 16px;
  margin: 0 0 24px 0;
  font-weight: 500;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.retry-upload-btn,
.fallback-questions-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--color-border-medium);
  color: var(--primary-600);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.retry-upload-btn svg,
.fallback-questions-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}

.retry-upload-btn:hover {
  background: var(--button-gradient);
  color: white;
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.fallback-questions-btn {
  background: var(--color-surface-hover);
  border-color: var(--primary-300);
  color: var(--primary-600);
}

.fallback-questions-btn:hover {
  background: var(--color-surface-active);
  color: var(--primary-700);
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

/* Modal Footer */
.image-upload-footer {
  background: rgba(6, 182, 212, 0.04);
  padding: 18px 24px;
  border-top: 1px solid var(--color-border-light);
}

.upload-tip-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tip-icon {
  width: 20px;
  height: 20px;
  color: var(--primary-500);
  flex-shrink: 0;
  margin-top: 2px;
  stroke: currentColor;
  stroke-width: 2;
}

.upload-tip {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: left;
  line-height: 1.6;
  font-weight: 500;
}

.upload-tip strong {
  color: var(--primary-600);
  font-weight: 700;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .image-upload-container {
    width: 95%;
    max-width: none;
    border-radius: 28px;
  }

  .image-upload-header {
    padding: 16px 20px;
  }

  .header-inner h3 {
    font-size: 17px;
  }

  .image-upload-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .drag-drop-zone {
    padding: 30px 16px;
  }

  .drag-drop-icon {
    width: 48px;
    height: 48px;
  }

  .drag-drop-zone h4 {
    font-size: 16px;
  }

  #preview-image {
    max-height: 250px;
    width: auto;
    display: block;
    margin: 0 auto;
  }

  .image-preview-container {
    padding: 10px 0;
  }

  .preview-wrapper {
    margin-bottom: 20px;
  }

  .upload-image-btn {
    width: 100%;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    padding: 18px 24px;
    margin-top: 10px;
  }

  .btn-text {
    font-size: 17px;
  }

  .upload-options {
    flex-direction: column;
    gap: 12px;
  }

  .upload-option-btn {
    max-width: 100%;
    padding: 20px 24px;
    min-height: 120px;
  }

  .option-icon {
    width: 44px;
    height: 44px;
  }

  .option-label {
    font-size: 16px;
    font-weight: 700;
  }

  .drag-drop-subtitle {
    font-size: 14px;
  }

  .upload-tip {
    font-size: 13px;
  }

  .camera-preview {
    aspect-ratio: 3/4;
  }

  .camera-controls {
    padding: 16px;
  }

  .camera-control-btn.capture {
    width: 64px;
    height: 64px;
  }

  .capture-inner {
    width: 40px;
    height: 40px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
  }

  .gallery-actions {
    flex-direction: column;
  }
}

/* Loading state for body scroll lock */
body.modal-open {
  overflow: hidden;
}
