/* FloorAssistant Widget - Professional Styling */

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

:root {
  --widget-primary: #1e40af;
  --widget-secondary: #64748b;
  --widget-bg: #ffffff;
  --widget-text: #1e293b;
  --widget-border: #e2e8f0;
  --widget-hover: #2563eb;
  --widget-accent: #f59e0b;
}

/* Widget Container */
.floor-assistant-widget {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 600px;
  margin: 0 auto;
  background: var(--widget-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Header */
.widget-header {
  background: linear-gradient(135deg, var(--widget-primary) 0%, var(--widget-hover) 100%);
  color: white;
  padding: 20px;
  text-align: center;
}

.widget-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.widget-subtitle {
  margin: 5px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
}

.language-selector {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.language-dropdown {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

.language-dropdown option {
  background: var(--widget-primary);
  color: white;
}

/* Quick Questions */
.quick-questions {
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--widget-border);
}

.quick-questions-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--widget-secondary);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-question-btn {
  background: white;
  border: 1px solid var(--widget-border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--widget-text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-question-btn:hover {
  background: var(--widget-primary);
  color: white;
  border-color: var(--widget-primary);
  transform: translateY(-1px);
}

/* Input Area */
.input-area {
  padding: 20px;
  border-bottom: 1px solid var(--widget-border);
}

.input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.text-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--widget-border);
  border-radius: 24px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--widget-primary);
}

.voice-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--widget-primary);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-btn:hover {
  background: var(--widget-hover);
  transform: scale(1.05);
}

.voice-btn.recording {
  background: #dc2626;
  animation: pulse 1.5s infinite;
}

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

/* Response Area */
.response-area {
  padding: 20px;
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
}

.response-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.response-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--widget-text);
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--widget-primary);
}

.response-text p {
  margin: 0;
}

/* Voice Controls */
.voice-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-control-btn {
  background: var(--widget-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.voice-control-btn:hover {
  background: var(--widget-hover);
  transform: translateY(-1px);
}

.voice-control-btn.stop-btn {
  background: #dc2626;
}

.voice-control-btn.pause-btn {
  background: var(--widget-accent);
}

.voice-control-btn.resume-btn {
  background: #10b981;
}

/* Media - Single Column Layout */
.response-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--widget-border);
  background: white;
}

.media-item img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s;
  object-fit: contain;
}

.media-item img:hover {
  transform: scale(1.05);
}

.media-item video {
  width: 100%;
  height: auto;
  display: block;
}

.media-caption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--widget-secondary);
  background: #f8fafc;
  border-top: 1px solid var(--widget-border);
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  margin: auto;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.modal-close:hover {
  color: #ff4444;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--widget-secondary);
}

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

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--widget-secondary);
  animation: bounce 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; }

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--widget-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
  margin: 0;
}

/* Error State */
.error-message {
  background: #fee2e2;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
  color: #991b1b;
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .floor-assistant-widget {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .response-area {
    flex: 1;
    max-height: none;
  }
  
  .voice-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
}

/* Search and Clear Buttons */
.search-btn, .clear-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn {
  background: var(--widget-primary);
}

.search-btn:hover {
  background: var(--widget-hover);
  transform: scale(1.05);
}

.clear-btn {
  background: var(--widget-secondary);
  width: 36px;
  height: 36px;
  font-size: 16px;
  position: absolute;
  right: 120px;
}

.clear-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}
