/* VoiceCraft Pro - Advanced Voice Studio Styles */

:root {
  --primary: #2563eb;
  --secondary: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Global scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-300 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-400 dark:bg-gray-500;
}

/* Recording visualization animation */
.recording-bar {
  animation: recordingPulse 1.5s ease-in-out infinite;
}

.recording-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.recording-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.recording-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.recording-bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes recordingPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.5);
  }
}

/* Card hover effects */
.card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Custom button styles */
.btn-primary {
  @apply bg-primary text-white px-4 py-2 rounded-md hover:bg-blue-600 transition-colors duration-200;
}

.btn-secondary {
  @apply bg-secondary text-white px-4 py-2 rounded-md hover:bg-violet-700 transition-colors duration-200;
}

.btn-success {
  @apply bg-success text-white px-4 py-2 rounded-md hover:bg-green-600 transition-colors duration-200;
}

.btn-danger {
  @apply bg-danger text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors duration-200;
}

/* Loading overlay */
#loadingOverlay {
  backdrop-filter: blur(4px);
}

/* Toast notifications */
.toast {
  @apply bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg p-4 max-w-sm;
  animation: slideInRight 0.3s ease-out;
}

.toast.success {
  @apply border-l-4 border-success;
}

.toast.error {
  @apply border-l-4 border-danger;
}

.toast.warning {
  @apply border-l-4 border-warning;
}

.toast.info {
  @apply border-l-4 border-primary;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Audio player customization */
audio {
  width: 100%;
  height: 40px;
}

audio::-webkit-media-controls-panel {
  @apply bg-gray-50 dark:bg-gray-700;
}

/* File input styling */
input[type="file"] {
  @apply file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-primary file:text-white hover:file:bg-blue-600 transition-colors duration-200;
}

/* Form controls focus states */
input:focus, select:focus, textarea:focus {
  outline: none;
  @apply ring-2 ring-primary ring-opacity-50 border-primary;
}

/* Responsive design utilities */
@media (max-width: 640px) {
  .container-mobile {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .text-responsive {
    font-size: 0.875rem;
  }
  
  .btn-responsive {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Dark mode transitions */
* {
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

/* Custom radio and checkbox styling */
input[type="radio"]:checked,
input[type="checkbox"]:checked {
  @apply bg-primary border-primary;
}

/* Pulse animation for active elements */
.pulse-primary {
  animation: pulsePrimary 2s infinite;
}

@keyframes pulsePrimary {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* Waveform visualization for audio */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(37, 99, 235, 0.1) 25%, 
    rgba(37, 99, 235, 0.3) 50%, 
    rgba(37, 99, 235, 0.1) 75%, 
    transparent 100%);
}

.waveform-bar {
  width: 3px;
  margin: 0 1px;
  background: var(--primary);
  border-radius: 1px;
  animation: waveform 1.5s ease-in-out infinite;
}

.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes waveform {
  0%, 100% {
    height: 10px;
    opacity: 0.5;
  }
  50% {
    height: 40px;
    opacity: 1;
  }
}

/* Tooltip styles */
.tooltip {
  @apply relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  @apply absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-xs rounded opacity-0 pointer-events-none transition-opacity duration-200;
}

.tooltip:hover::before {
  @apply opacity-100;
}

/* Voice visualization during playback */
.playing .recording-bar {
  animation-duration: 0.8s;
}

/* Custom select dropdown styling */
select {
  @apply appearance-none bg-no-repeat bg-right pr-10;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-size: 1.5em 1.5em;
}

/* Enhanced shadows for depth */
.shadow-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-card-hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Progress bar styling */
.progress-bar {
  @apply w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2;
}

.progress-fill {
  @apply bg-primary h-2 rounded-full transition-all duration-300;
}