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

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;
  --accent: #10b981;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}

/* --- Typography --- */
h1 {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #818cf8, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Auth Card --- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
  animation: fadeIn 0.6s ease-out;
}

.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.auth-tab {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.auth-tab.active {
  color: var(--primary);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

/* --- Forms --- */
.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

input {
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

button {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

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

button.secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
}

/* --- Dashboard --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* --- Progress Bar --- */
.progress-container {
  width: 100%;
  margin: 1.5rem 0;
  display: none;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.4s ease;
}

/* --- Transcription Area --- */
.result-container {
  margin-top: 2rem;
  display: none;
}

#texto {
  background: rgba(15, 23, 42, 0.8);
  padding: 1.5rem;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--glass-border);
  margin-top: 1rem;
  max-height: 500px;
  overflow-y: auto;
}

/* --- History --- */
.history-list {
  list-style: none;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.history-item .date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-item .preview {
  font-weight: 500;
  margin-top: 0.3rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Layout --- */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
  }

  .container {
    padding: 1rem;
  }
}

/* --- Navbar --- */
.navbar {
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(to right, #818cf8, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    gap: 1rem;
    animation: fadeInDown 0.3s ease;
  }

  .nav-menu.active {
    display: flex;
  }

  .user-badge {
    width: 100%;
    justify-content: space-between;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#user-email {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* --- Responsive Sidebar (Desktop vs Mobile) --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  z-index: 1000;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  aside.glass {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100vh;
    width: 85%;
    max-width: 400px;
    z-index: 999;
    transition: right 0.4s ease;
    border-radius: 0;
  }

  aside.glass.open {
    right: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .nav-logo {
    font-size: 1.1rem;
  }

  .navbar {
    padding: 0.8rem 1rem;
  }

  .container {
    padding: 1rem;
  }
}