/* Modern Mobile-First Chat Interface - FLC Branding */
:root {
  /* FLC Brand Colors - PANTONE 295C */
  --primary-color: #002855;
  --primary-dark: #001a3d;
  --primary-light: #003d7a;
  --secondary-color: #8E8E93;
  --accent-color: #0066b3;
  
  /* Gradient Background Colors */
  --gradient-start: #004d5a;
  --gradient-mid: #005a7a;
  --gradient-end: #0076b3;
  
  /* Surface Colors */
  --background-color: #001833;
  --background-light: #002244;
  --surface-color: #002855;
  --surface-light: #003366;
  
  /* Text Colors */
  --text-color: #FFFFFF;
  --text-secondary: #a3c9e8;
  --text-light: #b8d4ed;
  
  /* Bubble Colors */
  --bot-bubble: #003366;
  --user-bubble: #D94100;
  --border-color: #004477;
  
  /* Status Colors */
  --success-color: #34C759;
  --warning-color: #FF9F0A;
  --error-color: #FF453A;
  
  /* Shadows */
  --shadow: 0 2px 10px rgba(0, 40, 85, 0.3);
  --shadow-heavy: 0 4px 20px rgba(0, 40, 85, 0.4);
  --bubble-shadow: 0 1px 2px rgba(0, 40, 85, 0.3);
  --card-shadow: 0 4px 12px rgba(0, 40, 85, 0.4);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-First Layout */
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  max-height: 100vh;
  max-height: 100dvh;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
  position: relative;
  overflow: hidden;
}

/* Header - Fixed within app */
.chat-header {
  background: rgba(0, 40, 85, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.header-info {
  flex: 1;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Progress Bar */
.progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 1px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Chat Messages - Scrollable area between header and footer */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: 
    linear-gradient(rgba(0, 40, 85, 0.4), rgba(0, 64, 119, 0.5)),
    url('./images/background.jpg') center center no-repeat;
  background-size: 100% 100%;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  min-height: 0; /* Allow flex shrinking */
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 3px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 2px;
}

/* Enhanced Message Styling */
.message {
  display: flex;
  margin-bottom: 12px;
  animation: messageSlide 0.3s ease-out;
  align-items: flex-end;
  gap: 6px;
}

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

.message-bot {
  justify-content: flex-start;
}

.message-user {
  justify-content: flex-end;
}

.message-content {
  max-width: 90%;
  min-width: 60px;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--bubble-shadow);
}

.message-content ul {
  margin: -10px 0px -30px 10px;
  padding-left: 20px;
}

.message-content li {
  margin: 6px 0;
  line-height: 1.5;
}

.message-bot .message-content {
  background: var(--bot-bubble);
  color: var(--text-color);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color);
  margin-left: 4px;
}

.message-user .message-content {
  background: #D94100;
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(217, 65, 0, 0.3);
  margin-right: 4px;
}

/* Fixed Chat Bubble Arrows */
.message-bot .message-content::before {
  content: '';
  position: absolute;
  left: -5px;
  bottom: 2px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right: 6px solid var(--bot-bubble);
  border-left: 0;
  border-bottom: 0;
}

.message-bot .message-content::after {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 2px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right: 6px solid var(--border-color);
  border-left: 0;
  border-bottom: 0;
  z-index: -1;
}

.message-user .message-content::before {
  content: '';
  position: absolute;
  right: -5px;
  bottom: 2px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left: 6px solid var(--user-bubble);
  border-right: 0;
  border-bottom: 0;
}

.bot-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--bubble-shadow);
  border: 2px solid var(--border-color);
}

/* Chat Input Area - Footer within app */
.chat-input-area {
  background: var(--background-light);
  border-top: 1px solid var(--border-color);
  padding: 16px;
  min-height: 80px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-height: 50vh;
  overflow-y: auto;
  position: relative;
  z-index: 99;
  flex-shrink: 0;
  /* Safe area support for devices with notches/home indicators */
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.options-container {
  padding: 2px;
}
/* Enhanced Option Buttons */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 40vh;
  overflow-y: auto;
}

.option-button {
  background: #D94100;
  border: 1px solid #D94100;
  color: white;
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(254, 80, 0, 0.3);
  min-height: 56px;
  display: flex;
  align-items: center;
}

.option-button:hover {
  background: #D64300;
  border: 1px solid #D64300;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(160, 48, 0, 0.4);
}

.option-button:focus {
  background: #D94100;
  border: 1px solid #D94100;
  outline: none;
  box-shadow: 0 0 0 2px #D94100;
  color: white;
}

.option-button:active {
  transform: translateY(0);
  background: #8F2800;
  color: white;
  border: 1px solid #8F2800;
}

/* Back Button */
.back-button {
  background: rgba(0, 102, 179, 0.2);
  border: 1px solid #0066b3;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  width: fit-content;
}

.back-button:hover {
  background: #0066b3;
  border-color: #0066b3;
  color: #ffffff;
  transform: translateX(-2px);
  box-shadow: 0 2px 8px rgba(0, 102, 179, 0.4);
}

.back-button:active {
  transform: translateX(0);
  background: #003d7a;
  border-color: #003d7a;
  color: white;
}

.back-button .icon {
  width: 18px;
  height: 18px;
}

/* Loading Animation */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
  0%, 80%, 100% { 
    transform: scale(0);
  } 
  40% { 
    transform: scale(1);
  }
}

/* Clean Simple Result Card */
.result-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
  
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.result-icon {
  width: 38px;
  height: 32px;
  background: #D94100;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.result-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
}

.result-description {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 16px;
  line-height: 1.5;
  font-weight: 500;
}

.result-details {
  margin-top: 0;
}

.details-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.details-list {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 16px;
  border: 1px solid var(--border-color);
  display: grid;
  gap: 12px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 8px;
}

.detail-item.full-width {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 0;
}

.detail-question {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
  min-width: 0; /* Allow text to wrap */
}

.detail-answer {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
  flex-shrink: 0;
  word-break: break-word;
  max-width: 60%;
}

.detail-item.full-width .detail-answer {
  text-align: left;
  font-size: 14px;
  max-width: 100%;
}

.summary-card {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--border-color);
}

.summary-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item:last-child {
  border-bottom: none;
  padding-bottom: 6px;
}

.summary-question {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
}

.summary-answer {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
  flex-shrink: 0;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

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

.btn-primary {
  background: #D94100;
  color: white;
}

.btn-primary:hover {
  background: #D64300;
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--surface-color);
}

.btn-success {
  background: #D94100;
  color: white;
}

.btn-success:hover {
  background: #D64300;
}

@media (max-width: 768px) {
  .result-card {
    padding: 14px;
    margin: 8px 0;
  }
  
  .result-header {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  
  .result-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .result-title {
    font-size: 15px;
  }
  
  .details-list, .summary-card {
    padding: 12px;
    gap: 8px;
  }
  
  .detail-item, .summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 0;
  }
  
  .detail-question, .summary-question {
    font-size: 13px;
    margin-bottom: 2px;
  }
  
  .detail-answer, .summary-answer {
    text-align: left;
    font-size: 14px;
    max-width: 100%;
    word-break: break-word;
  }
  
  .detail-item.full-width {
    gap: 6px;
    padding: 10px 0;
  }
  
  .action-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Remove old styles */
.detail-mini,
.detail-row,
.detail-icon,
.detail-text,
.detail-label,
.detail-value,
.details-compact {
  display: none !important;
}

/* Responsive Design */
@media (min-width: 768px) {
  .chat-app {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    height: calc(100vh - 40px);
  }
  
  .chat-header {
    border-radius: 16px 16px 0 0;
  }
  
  body {
    background: #111111;
    padding: 20px;
  }
  
  /* Enhanced desktop details list */
  .details-list {
    padding: 20px;
    gap: 16px;
  }

  .detail-item {
    padding: 16px 0;
    gap: 20px;
  }

  .detail-question {
    font-size: 14px;
  }

  .detail-answer {
    font-size: 14px;
    max-width: 50%;
  }

  .detail-item.full-width {
    padding: 18px 0;
    gap: 10px;
  }

  .details-cards {
    grid-template-columns: 1fr 1fr;
  }
  
  .detail-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .detail-card-value {
    text-align: left;
  }
  
  .detail-card.full-width {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .chat-app {
    max-width: 480px;
  }
}

/* Medium screens (tablets) */
@media (min-width: 481px) and (max-width: 767px) {
  .details-list {
    padding: 14px;
    gap: 10px;
  }

  .detail-item {
    padding: 10px 0;
    gap: 12px;
  }

  .detail-question {
    font-size: 14px;
  }

  .detail-answer {
    font-size: 14px;
    max-width: 55%;
  }

  .detail-item.full-width {
    padding: 12px 0;
    gap: 6px;
  }
}

/* Mobile Optimization */
@media (max-width: 480px) {
  /* Ensure proper mobile layout */
  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    width: 100%;
  }
  
  .chat-app {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .chat-header {
    padding: 10px 16px;
    min-height: 60px;
    position: relative;
    z-index: 101;
    flex-shrink: 0;
  }
  
  .chat-messages {
    flex: 1;
    padding: 8px 12px;
    padding-bottom: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Prevent bounce scrolling on iOS */
    overscroll-behavior: contain;
    min-height: 0;
  }
  
  .chat-input-area {
    position: relative;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 70px;
    max-height: 60vh;
    z-index: 100;
    flex-shrink: 0;
    /* Prevent iOS Safari bottom bar issues */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  
  .options-container {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .message-content {
    max-width: 85%;
    font-size: 14px;
    padding: 12px 16px;
  }

  .option-button {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 52px;
  }

  .result-card {
    margin: 8px 0;
    padding: 12px;
  }

  .result-title {
    font-size: 15px;
  }

  .result-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .action-btn {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  /* Enhanced responsive details list */
  .details-list {
    padding: 10px;
    gap: 6px;
  }

  .detail-item {
    padding: 6px 0;
    gap: 4px;
  }

  .detail-question {
    font-size: 12px;
    line-height: 1.4;
  }

  .detail-answer {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    hyphens: auto;
  }

  .detail-item.full-width {
    padding: 8px 0;
    gap: 4px;
  }

  .details-cards {
    gap: 8px;
  }

  .detail-card {
    padding: 12px;
    font-size: 13px;
  }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
  :root {
    --gradient-start: #004d5a;
    --gradient-mid: #005a7a;
    --gradient-end: #0076b3;
  }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #666666;
    --text-secondary: #CCCCCC;
  }
}

/* Large text support */
@media (prefers-contrast: more) {
  .option-button, .action-btn {
    font-size: 18px;
    padding: 18px;
  }
  
  .message-content {
    font-size: 18px;
  }
}

/* Print styles */
@media print {
  .chat-app {
    height: auto;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .chat-header, .chat-input-area {
    display: none;
  }
  
  .chat-messages {
    overflow: visible;
  }
  
  .message-content {
    background: white !important;
    color: black !important;
    border: 1px solid #000;
  }
}

/* Enhanced SVG Icon Styling */
.icon {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.bot-avatar .icon {
  color: white;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0, 40, 85, 0.3));
}

/* Enhanced Result Card Icon Styling */
.result-icon .icon {
  color: white;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(52, 199, 89, 0.4));
}

/* Beautiful Detail Label Icons */
.detail-card-label .icon {
  stroke-width: 2.2;
  margin-right: 6px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Specific colors for each detail type */
.detail-card-label .icon[data-lucide="tag"] {
  color: #FF6B6B;
  stroke: #FF6B6B;
}

.detail-card-label .icon[data-lucide="dollar-sign"] {
  color: #4ECDC4;
  stroke: #4ECDC4;
}

.detail-card-label .icon[data-lucide="users"] {
  color: #45B7D1;
  stroke: #45B7D1;
}

.detail-card-label .icon[data-lucide="target"] {
  color: #96CEB4;
  stroke: #96CEB4;
}

/* Result Details Header Icon */
.details-header .icon {
  color: var(--success-color);
  stroke-width: 2.2;
  margin-right: 8px;
  filter: drop-shadow(0 1px 3px rgba(52, 199, 89, 0.3));
}

.summary-header .icon {
  color: var(--primary-color);
  stroke-width: 2.2;
  margin-right: 8px;
  filter: drop-shadow(0 1px 3px rgba(0, 40, 85, 0.3));
}

.action-btn .icon {
  margin-right: 8px;
  stroke-width: 2.1;
  transition: all 0.2s ease;
}

.btn-primary .icon {
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.btn-secondary .icon {
  color: var(--text-color);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.btn-success .icon {
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Message content icons */
.message-content .icon {

  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.message-bot .message-content .icon:first-child {
  color: var(--text-color);
}

.message-content .icon[data-lucide="lightbulb"] {
  color: #FFA726;
  stroke: #FFA726;
}

.message-content .icon[data-lucide="smile"] {
  color: #FFD54F;
  stroke: #FFD54F;
}

.message-content .icon[data-lucide="phone"] {
  color: var(--primary-color);
  stroke: var(--primary-color);
}

.message-content .icon[data-lucide="alert-triangle"] {
  color: var(--error-color);
  stroke: var(--error-color);
}

/* Enhanced hover effects for icons */
.option-button:hover .icon,
.action-btn:hover .icon {
  transform: scale(1.15);
  transition: transform 0.2s ease;
}

.detail-card:hover .detail-card-label .icon {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Icon alignment fixes */
.detail-card {
  align-items: center;
}

.detail-card-label {
  display: flex;
  align-items: center;
}

.summary-header {
  display: flex;
  align-items: center;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure proper spacing in text with icons */
.message-content p:first-child .icon:first-child {
  margin-right: 8px;
}

/* Icon responsiveness */
@media (max-width: 480px) {
  .icon {
    stroke-width: 2;
  }
  
  .bot-avatar .icon,
  .result-icon .icon {
    stroke-width: 2.2;
  }
  
  .detail-card-label .icon {
    stroke-width: 2;
    margin-right: 4px;
  }
  
  .action-btn .icon {
    margin-right: 6px;
  }
}

/* Enhanced animation for icons */
@keyframes iconPulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 2px 4px rgba(52, 199, 89, 0.4));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 3px 6px rgba(52, 199, 89, 0.6));
  }
}

.result-icon .icon {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconGlow {
  0%, 100% { 
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  }
  50% { 
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  }
}

.detail-card-label .icon {
  animation: iconGlow 3s ease-in-out infinite;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .icon {
    stroke-width: 2.5;
  }
  
  .detail-card-label .icon {
    color: var(--text-color);
    stroke: var(--text-color);
  }
}

/* Dark mode optimizations for icons */
.icon {
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));
}

/* Loading state for icons */
.icon.loading {
  animation: spin 1s linear infinite;
}

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

/* Focus states for accessibility */
.action-btn:focus .icon,
.option-button:focus .icon {
  outline: 2px solid #D94100;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Very small screens (iPhone SE, small Android phones) */
@media (max-width: 375px) {
  .chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }
  
  .chat-header {
    padding: 8px 12px;
    min-height: 55px;
    flex-shrink: 0;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .header-subtitle {
    font-size: 12px;
  }
  
  .chat-messages {
    flex: 1;
    padding: 6px 10px;
    padding-bottom: 16px;
    min-height: 0;
  }
  
  .chat-input-area {
    position: relative;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    min-height: 65px;
    flex-shrink: 0;
  }
  
  .message-content {
    font-size: 13px;
    padding: 10px 14px;
    max-width: 90%;
  }
  
  .option-button {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 48px;
  }
  
  .result-card {
    padding: 10px;
  }
  
  .action-btn {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
  }

  /* Ultra-responsive details list for very small screens */
  .details-list {
    padding: 8px;
    gap: 4px;
  }

  .detail-item {
    padding: 4px 0;
    gap: 3px;
  }

  .detail-question {
    font-size: 11px;
    line-height: 1.3;
  }

  .detail-answer {
    font-size: 12px;
    line-height: 1.3;
  }

  .detail-item.full-width {
    padding: 6px 0;
    gap: 3px;
  }

  .details-header {
    font-size: 12px;
    margin-bottom: 8px;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }
  
  .chat-header {
    min-height: 50px;
    padding: 8px 16px;
    flex-shrink: 0;
  }
  
  .chat-messages {
    flex: 1;
    padding-bottom: 16px;
    min-height: 0;
  }
  
  .chat-input-area {
    position: relative;
    min-height: 60px;
    max-height: 40vh;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
  
  .options-container {
    max-height: 30vh;
  }
  
  .option-button {
    padding: 10px 16px;
    min-height: 44px;
  }
  
  .message-content {
    font-size: 14px;
    padding: 8px 12px;
  }

  /* Compact details list for landscape */
  .details-list {
    padding: 8px;
    gap: 4px;
  }

  .detail-item {
    padding: 4px 0;
    gap: 4px;
  }

  .detail-question {
    font-size: 12px;
  }

  .detail-answer {
    font-size: 13px;
  }

  .detail-item.full-width {
    padding: 6px 0;
    gap: 3px;
  }
}

/* Support for devices with notches and safe areas */
@supports (padding: max(0px)) {
  .chat-header {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(12px, env(safe-area-inset-top));
  }
  
  .chat-input-area {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  
  .chat-messages {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
} 