/* ============================================
   RemindMe — Dark Glassmorphism Design
   Modern, sleek, immersive
   ============================================ */

:root {
  --bg-base: #f4ebd8;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  --accent-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  --accent-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  
  --success: #38a169;
  --recording: #e53e3e;
  
  --font: Georgia, 'Times New Roman', Times, serif;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  padding: 24px 20px 180px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.search-container {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding-left: 38px !important;
  height: 42px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.glass-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-icon {
  width: 44px;
  height: 44px;
}

/* Status Area */
.status-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.date-range-group input {
  flex: 1;
}

.date-range-separator {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s;
}

.status-text.recording { color: var(--recording); }
.status-text.success { color: var(--success); }

.language-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

/* Glass Cards */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  transition: all 0.4s var(--ease);
}

/* Live Transcript */
.transcript-card {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
}

.transcript-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.transcript-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.vis-bar {
  width: 5px;
  height: 4px;
  background-color: var(--recording);
  border-radius: 3px;
  transition: height 0.1s ease;
}

.visualizer.active .vis-bar {
  animation: bounce-bar 0.8s ease-in-out infinite alternate;
}
.visualizer.active .vis-bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer.active .vis-bar:nth-child(2) { animation-delay: 0.3s; }
.visualizer.active .vis-bar:nth-child(3) { animation-delay: 0.0s; }
.visualizer.active .vis-bar:nth-child(4) { animation-delay: 0.4s; }
.visualizer.active .vis-bar:nth-child(5) { animation-delay: 0.2s; }

@keyframes bounce-bar {
  0% { height: 4px; opacity: 0.5; }
  100% { height: 20px; opacity: 1; }
}

.transcript-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--recording);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.transcript-text {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.transcript-text .interim { color: var(--text-muted); }

/* Result Card */
.result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slide-up 0.4s var(--ease);
}

.result-icon-container {
  font-size: 2rem;
  background: var(--glass-bg);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.result-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Notes Feed (Vertical List) */
.notes-feed { flex: 1; display: flex; flex-direction: column; }

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s var(--ease);
  animation: slide-up 0.5s var(--ease) backwards;
  cursor: pointer;
}

.note-item:hover {
  transform: translateY(-2px);
  background: var(--glass-bg);
  border-color: rgba(255,255,255,0.15);
}

.note-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Note Actions (Expanded State) */
.note-actions {
  display: none;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  animation: slide-up 0.3s var(--ease);
}

.note-item.expanded .note-actions {
  display: flex;
}

.btn-action {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px 4px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  transition: all 0.2s var(--ease);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.action-icon {
  font-size: 1rem;
}

/* States (Done & Important) */
.note-item.done {
  opacity: 0.6;
}
.note-item.done .note-content {
  text-decoration: line-through;
  color: var(--text-muted);
}
.note-item.done .btn-done {
  background: rgba(72, 187, 120, 0.15);
  color: #48BB78;
  border-color: rgba(72, 187, 120, 0.3);
}

.note-item.important {
  border-color: rgba(255, 193, 7, 0.4);
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.05);
}
.note-item.important .note-item-header::after {
  content: '⭐';
  font-size: 1rem;
}
.note-item.important .btn-important {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border-color: rgba(255, 193, 7, 0.3);
}

.note-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.05);
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.note-lang-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  margin-left: 4px;
  color: var(--text-muted);
}

.note-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}



.note-folder-header {
  background: rgba(255, 193, 7, 0.05);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.note-folder-header:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.4);
}

.folder-title {
  color: #ffc107;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Hide default marker for cleaner look */
.note-folder-header::marker {
  content: '';
}
.note-folder-header::-webkit-details-marker {
  display: none;
}

.note-folder-content {
  padding-top: 12px;
  padding-left: 12px;
  margin-top: 8px;
  border-left: 2px solid rgba(255, 193, 7, 0.2);
  margin-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.note-content {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.note-extra {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.notes-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

/* FAB - New Button */
.fab-container {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.btn-new {
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 18px 40px;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: var(--accent-shadow);
  transition: all 0.3s var(--ease);
}

.btn-new:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

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

.btn-new.recording {
  background: var(--recording);
  box-shadow: 0 4px 20px rgba(245, 101, 101, 0.4);
  animation: button-pulse 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  padding: 8px 20px;
}

#audioVisualizer {
  display: block;
}
#audioVisualizer.hidden {
  display: none;
}

@keyframes button-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(245, 101, 101, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0); }
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s var(--ease);
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.glass-modal {
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 32px 32px 0 0;
  padding: 32px 24px 40px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
  animation: slide-up 0.4s var(--ease);
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .glass-modal { border-radius: 24px; border-bottom: 1px solid var(--glass-border); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 { font-size: 1.4rem; font-weight: 600; }

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.glass-input {
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
}

.glass-input:focus { border-color: rgba(0,0,0,0.2); }

.glass-input option { 
  background: var(--bg-base); 
  color: var(--text-primary); 
}

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-primary:hover { background: var(--text-secondary); transform: translateY(-2px); }

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

.btn-full { width: 100%; }

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-footer button {
  flex: 1;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 24px; }

.setup-icon { font-size: 3.5rem; margin-bottom: 16px; }
.setup-desc { color: var(--text-secondary); line-height: 1.5; margin-bottom: 32px; }

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 500;
  padding: 12px;
  margin-top: 8px;
  cursor: pointer;
  transition: color 0.3s;
}
.btn-text:hover { color: white; }

.hidden { display: none !important; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   LOGIN SCREEN
   ========================================= */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(244, 235, 216, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: 90%;
  max-width: 400px;
  padding: 40px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.google-btn-wrapper {
  margin-top: 20px;
  min-height: 40px;
  display: flex;
  justify-content: center;
}

.login-error {
  color: var(--danger-color);
  font-size: 0.9rem;
  margin-top: 15px;
  background: rgba(255, 69, 58, 0.1);
  padding: 10px;
  border-radius: 8px;
}
.settings-hint {
  display: block;
  margin-top: 5px;
}
