/* ============================================================
   SPRACHNOTIZEN APP - STYLESHEET
   Premium Dark Theme with Glassmorphism
   ============================================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Background */
  --bg-primary: #0a0a1a;
  --bg-secondary: #11112a;
  --bg-tertiary: #1a1a3e;
  --bg-elevated: #1e1e42;

  /* Glass */
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --glass-active: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  /* Primary (Violet) */
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.3);
  --primary-subtle: rgba(139, 92, 246, 0.1);

  /* Accent */
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;

  /* Semantic */
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f0f23;

  /* Border */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe Areas (iOS) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--bg-primary);
  padding: var(--space-lg);
}

.login-container {
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: fadeInUp 0.6s ease;
}

.login-logo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-glow);
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--primary-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 32px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  justify-content: center;
}

.login-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn svg {
  width: 24px;
  height: 24px;
}

.login-error {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.875rem;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 200;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--space-md) var(--space-lg);
  padding-top: calc(var(--space-md) + var(--safe-top));
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.header-brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
}

.header-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary);
  object-fit: cover;
}

/* ---------- Search Bar ---------- */
.search-bar {
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ---------- Category Filter ---------- */
.category-filter {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary-light);
}

.filter-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-chip .chip-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.filter-chip.active .chip-count {
  background: rgba(139, 92, 246, 0.2);
}

/* ============================================================
   NOTES LIST
   ============================================================ */
.notes-container {
  padding: 0 var(--space-lg) var(--space-lg);
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-top: var(--space-sm);
}

.notes-header h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ---------- Note Card ---------- */
.note-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.note-card:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.note-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.note-card-info {
  flex: 1;
  min-width: 0;
  padding-left: var(--space-sm);
}

.note-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.note-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.note-card-meta svg {
  width: 14px;
  height: 14px;
}

.note-card-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.note-card-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-left: var(--space-sm);
}

.note-play-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.note-play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.note-play-btn.playing {
  background: var(--accent-pink);
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
  animation: pulse-glow 1.5s infinite;
}

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

.note-waveform {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-sm);
}

.note-waveform-bar {
  flex: 1;
  max-width: 4px;
  background: var(--glass-border);
  border-radius: 2px;
  transition: background var(--transition-fast);
  min-height: 4px;
}

.note-waveform-bar.active {
  background: var(--primary);
}

.note-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.note-card-actions {
  display: flex;
  gap: var(--space-xs);
}

.note-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.note-action-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.note-action-btn.delete:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
}

.note-action-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

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

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 280px;
  margin: 0 auto;
}

/* ============================================================
   FLOATING ACTION BUTTON (RECORD)
   ============================================================ */
.fab {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--primary-glow), var(--shadow-lg);
  z-index: 40;
  transition: all var(--transition-normal);
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px var(--primary-glow), var(--shadow-lg);
}

.fab:active {
  transform: scale(0.95);
}

.fab svg {
  width: 28px;
  height: 28px;
}

/* ============================================================
   RECORDING MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-bottom: none;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--glass-border);
  border-radius: 2px;
  margin: 0 auto var(--space-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-hover);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

/* Recording UI */
.record-section {
  text-align: center;
  padding: var(--space-xl) 0;
}

.record-timer {
  font-size: 3rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  letter-spacing: 2px;
}

.record-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  margin-bottom: var(--space-xl);
}

.record-visualizer .viz-bar {
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 100ms ease;
  min-height: 4px;
}

.record-btn-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.record-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-normal);
}

.record-btn::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.3);
  transition: all var(--transition-normal);
}

.record-btn.recording::before {
  animation: pulse-ring 1.5s infinite;
}

.record-btn:hover {
  transform: scale(1.05);
}

.record-btn:active {
  transform: scale(0.95);
}

.record-btn .record-icon {
  width: 28px;
  height: 28px;
  background: white;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.record-btn.recording .record-icon {
  border-radius: 6px;
  width: 24px;
  height: 24px;
}

.record-secondary-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.record-secondary-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.record-secondary-btn svg {
  width: 22px;
  height: 22px;
}

.record-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.record-status.recording-active {
  color: var(--danger);
  animation: blink 1s infinite;
}

/* Save form */
.save-form {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.category-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.category-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.category-option:hover {
  background: var(--glass-hover);
}

.category-option.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.category-option .cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-option .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  gap: var(--space-md);
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* ============================================================
   CATEGORIES MODAL
   ============================================================ */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.category-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.category-item:hover {
  background: var(--glass-hover);
}

.category-item-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.category-item-info {
  flex: 1;
  min-width: 0;
}

.category-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.category-item-actions {
  display: flex;
  gap: var(--space-xs);
}

.add-category-btn {
  width: 100%;
  padding: var(--space-md);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-top: var(--space-sm);
}

.add-category-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-subtle);
}

.add-category-btn svg {
  width: 20px;
  height: 20px;
}

/* New/Edit Category Form */
.category-form {
  padding: var(--space-lg) 0;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

.color-option {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 3px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: white;
  box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 10px rgba(255, 255, 255, 0.2);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-sm);
}

.icon-option {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--glass);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.icon-option:hover {
  background: var(--glass-hover);
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

/* ============================================================
   USER MENU DROPDOWN
   ============================================================ */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: var(--space-lg);
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-normal);
  z-index: 60;
}

.user-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.user-menu-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-menu-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: 12px var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.user-menu-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.user-menu-item.danger {
  color: var(--danger);
}

.user-menu-item.danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.user-menu-item svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  padding: var(--space-lg);
}

.confirm-dialog-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.confirm-dialog-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.confirm-dialog h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.confirm-dialog p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.confirm-dialog-actions {
  display: flex;
  gap: var(--space-md);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--space-lg) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: calc(100% - 2 * var(--space-lg));
  max-width: 400px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: auto;
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast-icon {
  font-size: 1.1rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

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

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
  }

  50% {
    box-shadow: 0 2px 20px rgba(236, 72, 153, 0.6);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.note-card {
  animation: fadeInUp 0.4s ease backwards;
}

.note-card:nth-child(1) {
  animation-delay: 0.05s;
}

.note-card:nth-child(2) {
  animation-delay: 0.1s;
}

.note-card:nth-child(3) {
  animation-delay: 0.15s;
}

.note-card:nth-child(4) {
  animation-delay: 0.2s;
}

.note-card:nth-child(5) {
  animation-delay: 0.25s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border);
    max-height: 85vh;
  }

  .modal-overlay {
    align-items: center;
  }

  .notes-container {
    max-width: 640px;
    margin: 0 auto;
  }

  .app-header {
    padding: 0 var(--space-xl);
  }
}

/* ============================================================
   TRANSCRIPT UI
   ============================================================ */
.transcript-preview {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  max-height: 120px;
  overflow-y: auto;
  transition: all var(--transition-fast);
}

.transcript-preview.hidden {
  display: none;
}

.transcript-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

.transcript-text {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0;
}

.transcript-text.hidden {
  display: none;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  color: var(--text-primary);
}

.note-transcript {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-transcript-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

/* ============================================================
   TRANSCRIPT UI
   ============================================================ */
.transcript-preview {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  max-height: 120px;
  overflow-y: auto;
  transition: all var(--transition-fast);
}

.transcript-preview.hidden {
  display: none;
}

.transcript-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

.transcript-text {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0;
}

.transcript-text.hidden {
  display: none;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.note-transcript {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-transcript-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

max-width: 640px;
margin: 0 auto;
border-left: 1px solid var(--border);
border-right: 1px solid var(--border);
}

.category-filter {
  max-width: 640px;
  margin: 0 auto;
}
}

/* ============================================================
   AUDIO PROGRESS BAR
   ============================================================ */
.audio-progress {
  flex: 1;
  height: 6px;
  background: var(--glass);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  border-radius: 3px;
  width: 0%;
  transition: width 100ms linear;
}

/* iOS specific adjustments */
@supports (-webkit-touch-callout: none) {
  .record-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .fab {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Uploading state */
.uploading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.uploading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-progress {
  width: 200px;
  height: 4px;
  background: var(--glass);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  border-radius: 2px;
  width: 0%;
  transition: width 200ms ease;
}

/* Note title edit */
.note-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  padding: 4px 0;
  width: 100%;
  outline: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.note-title-input:focus {
  border-bottom-color: var(--primary);
}