/* ============================================================
   public/assets/styles.css
   Diseño premium: dark mode con glassmorphism y animaciones
   ============================================================ */

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

/* ---------- Reset & Variables ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base:        #0a0b10;
  --bg-surface:     #10121a;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --border:         rgba(255,255,255,0.08);
  --border-active:  rgba(139,92,246,0.6);

  --accent:         #8b5cf6;
  --accent-light:   #a78bfa;
  --accent-glow:    rgba(139,92,246,0.25);
  --accent-2:       #06b6d4;

  --text-primary:   #f0f0f5;
  --text-secondary: #9ca3af;
  --text-muted:     #4b5563;

  --success:        #10b981;
  --error:          #ef4444;
  --warning:        #f59e0b;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-card: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-btn:  0 4px 24px rgba(139,92,246,0.35);

  --transition: 0.2s ease;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem 4rem;
  line-height: 1.6;

  /* Animated gradient background */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139,92,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6,182,212,0.06) 0%, transparent 50%);
}

/* ---------- Header ---------- */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeDown 0.6s ease both;
}

.app-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
}

.logo-icon svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.app-title {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ---------- Card Principal ---------- */
.card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.6s 0.1s ease both;
}

/* ---------- Drop Zone ---------- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--border-active);
  background: rgba(139,92,246,0.05);
  transform: translateY(-2px);
}

.drop-zone.has-file {
  border-color: var(--success);
  border-style: solid;
  background: rgba(16,185,129,0.05);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(139,92,246,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.drop-zone.has-file .drop-icon {
  background: rgba(16,185,129,0.15);
}

.drop-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
  transition: stroke var(--transition);
}

.drop-zone.has-file .drop-icon svg {
  stroke: var(--success);
}

.drop-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.drop-label strong {
  color: var(--accent-light);
  font-weight: 600;
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-info {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: rgba(16,185,129,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
  justify-content: center;
}

.drop-zone.has-file .file-info {
  display: flex;
}

/* ---------- Selector de idioma ---------- */
.lang-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.lang-row label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.lang-select {
  flex: 1;
  appearance: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.55rem 2.2rem 0.55rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.lang-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Botón Transcribir ---------- */
.btn-transcribe {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.btn-transcribe:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(139,92,246,0.45);
}

.btn-transcribe:active:not(:disabled) {
  transform: translateY(0);
}

.btn-transcribe:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-transcribe svg {
  width: 18px;
  height: 18px;
}

/* ---------- Barra de progreso ---------- */
.progress-wrap {
  display: none;
  margin: 1rem 0;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-wrap.visible {
  display: flex;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

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

.progress-bar-fill.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.5s infinite ease-in-out;
}

.progress-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- Estado / Resultado ---------- */
.result-section {
  display: none;
  margin-top: 1.5rem;
  animation: fadeUp 0.4s ease both;
}

.result-section.visible {
  display: block;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

.result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

.btn-copy.copied {
  border-color: var(--success);
  color: var(--success);
  background: rgba(16,185,129,0.1);
}

.btn-copy svg {
  width: 14px;
  height: 14px;
}

.result-textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.7;
  padding: 1rem;
  resize: vertical;
  transition: border-color var(--transition);
}

.result-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Alerta de error ---------- */
.alert {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.875rem;
  animation: fadeUp 0.3s ease both;
}

.alert.visible {
  display: flex;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: var(--error);
}

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  animation: fadeUp 0.6s 0.3s ease both;
}

.app-footer a {
  color: var(--accent-light);
  text-decoration: none;
}

/* ---------- Animaciones ---------- */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes indeterminate {
  0%   { margin-left: 0%; }
  50%  { margin-left: 50%; }
  100% { margin-left: 0%; }
}

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

.spin { animation: spin 1s linear infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .card { padding: 1.5rem 1.25rem; }
  .app-title { font-size: 1.45rem; }
}
