/* MyTripSpeak - Estilos globales */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --success-light: #e6f4ea;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --warning: #f29900;
  --warning-light: #fef7e0;
  --gray-light: #f1f3f4;
  --gray-medium: #dadce0;
  --gray-dark: #202124;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --bg-page: #f4f4f9;
  --bg-card: #ffffff;
  --border-radius: 8px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 30px;
}

/* Header */
h1, h2 {
  color: var(--primary);
}

h1 {
  font-size: 28px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

/* Canvas visualizer */
#visualizer {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, var(--gray-light) 0%, #e8e8e8 100%);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: none;
  box-shadow: var(--shadow);
}

/* Textarea */
#prompt_usuario {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 15px;
  border: 1px solid var(--gray-medium);
  border-radius: var(--border-radius);
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

#prompt_usuario:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

#prompt_usuario::placeholder {
  color: var(--text-secondary);
}

/* Buttons */
button {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 0.3px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-mic {
  background-color: var(--primary);
  color: white;
}

.btn-mic:hover {
  background-color: var(--primary-dark);
}

.btn-recording {
  background-color: var(--danger);
  color: white;
  animation: pulse 1.5s infinite;
}

.btn-recording:hover {
  background-color: #c5221f;
}

#btn-enviar {
  background-color: var(--success);
  color: white;
  display: none;
}

#btn-enviar:hover {
  background-color: #1d7a3e;
}

/* Results container */
#resultados {
  margin-top: 24px;
}

.metric {
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.08) 0%, rgba(52, 168, 83, 0.08) 100%);
  padding: 16px;
  border-left: 4px solid var(--primary);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--primary);
  font-size: 18px;
}

.hotel-info {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-left: 3px solid var(--success);
  font-size: 15px;
}

.hotel-info strong {
  color: var(--text-primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--gray-medium);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

.card h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.card p {
  margin: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.cost-info {
  background: var(--danger-light);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
}

.cost-details {
  background: var(--gray-light);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
}

.logistics {
  background: var(--success-light);
  padding: 12px;
  border-left: 4px solid var(--success);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-primary);
}

.maps-badge {
  display: inline-block;
  background-color: var(--success);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.logistics strong {
  color: #1d7a3e;
}

.logistics-item {
  margin: 4px 0;
}

iframe {
  width: 100%;
  border-radius: var(--border-radius);
  margin-top: 12px;
  border: none;
  box-shadow: var(--shadow);
}

.video-error {
  background: var(--warning-light);
  color: var(--warning);
  padding: 10px;
  border-radius: var(--border-radius);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
}

/* Error messages */
.error-message {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 16px;
  border-radius: var(--border-radius);
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
}

.error-message.quota {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

.error-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.error-detail {
  font-size: 13px;
  margin-top: 6px;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

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

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 16px;
    padding-top: 20px;
  }

  h1 {
    font-size: 24px;
  }

  button {
    padding: 12px 14px;
    font-size: 15px;
  }

  .card {
    padding: 12px;
  }

  .metric {
    font-size: 16px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --gray-light: #3a3a3a;
    --gray-medium: #4a4a4a;
  }

  body {
    background-color: var(--bg-page);
  }

  button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* Dark mode toggle class */
html.dark-mode {
  --bg-page: #1a1a1a;
  --bg-card: #2a2a2a;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --gray-light: #3a3a3a;
  --gray-medium: #4a4a4a;
}

html.dark-mode body {
  background-color: var(--bg-page);
}

html.dark-mode button:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 1000;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle:active {
  transform: scale(0.95);
}
