/**
 * Main CSS
 * Imports all stylesheets
 */

@import url('variables.css');
@import url('base.css');
@import url('components.css');
@import url('animations.css');

/* Additional custom styles */

/* Error states */
.error-message {
  background: rgba(196, 30, 58, 0.1);
  border: 1px solid var(--color-red-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--color-red-primary);
  margin: var(--space-md) 0;
}

/* Success states */
.success-message {
  background: rgba(0, 168, 107, 0.1);
  border: 1px solid var(--color-jade);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--color-jade);
  margin: var(--space-md) 0;
}

/* Info states */
.info-message {
  background: rgba(74, 144, 226, 0.1);
  border: 1px solid var(--color-blue-info);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--color-blue-info);
  margin: var(--space-md) 0;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-md);
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-ink-light);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
  color: var(--color-ink-light);
}

.empty-state-icon {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-lg);
}

.modal {
  background: var(--color-paper-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: var(--max-width-sm);
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-base) ease-out;
}

.modal-header {
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-xl);
}

/* Back button */
.back-button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-ink-light);
  font-size: var(--font-size-sm);
  padding: var(--space-sm);
  transition: color var(--transition-fast);
}

.back-button:hover {
  color: var(--color-red-primary);
}

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-paper-light);
  border-radius: var(--radius-lg);
  margin-top: var(--space-sm);
}

.play-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: var(--color-red-primary);
  color: var(--color-paper-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.play-button:hover {
  background: var(--color-red-hover);
  transform: scale(1.05);
}

.waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 2rem;
}

.waveform-bar {
  flex: 1;
  background: var(--color-ink-medium);
  border-radius: var(--radius-sm);
  min-width: 2px;
}

/* Recording status */
.recording-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(196, 30, 58, 0.1);
  border-radius: var(--radius-lg);
  color: var(--color-red-primary);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-md);
}

.recording-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--color-red-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-ink-black);
  color: var(--color-paper-white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--color-gray-400);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-red-primary);
  transition: width var(--transition-base);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.badge-primary {
  background: var(--color-red-primary);
  color: var(--color-paper-white);
}

.badge-secondary {
  background: var(--color-gray-300);
  color: var(--color-ink-black);
}

/* Card */
.card {
  background: var(--color-paper-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-gray-300);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-gray-300);
  margin: var(--space-lg) 0;
}

/* Hide on mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Safe area insets for mobile devices */
@supports (padding: max(0px)) {
  .chat-container {
    padding-bottom: max(env(safe-area-inset-bottom), var(--space-md));
  }

  .chat-input-area {
    padding-bottom: max(env(safe-area-inset-bottom), var(--space-lg));
  }
}
