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

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

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  padding-bottom: 40px;
}

/* ===== TEMAS ===== */
body[data-theme="claro"] {
  background: #f5f6fa;
  color: #1e1e2f;
  --card-bg: #ffffff;
  --accent: #6c5ce7;
  --accent-hover: #5a4bd6;
  --danger: #e74c3c;
  --border: #e0e0e0;
}

body[data-theme="escuro"] {
  background: #121218;
  color: #f1f1f1;
  --card-bg: #1e1e2a;
  --accent: #8a7bff;
  --accent-hover: #a396ff;
  --danger: #ff6b6b;
  --border: #2c2c3a;
}

body[data-theme="pastel"] {
  background: #fdf3f7;
  color: #4a3b4d;
  --card-bg: #fff9fb;
  --accent: #ff9ec4;
  --accent-hover: #ff85b8;
  --danger: #e8607b;
  --border: #f4d9e4;
}

body[data-theme="alto-contraste"] {
  background: #000000;
  color: #ffff00;
  --card-bg: #0d0d0d;
  --accent: #ffff00;
  --accent-hover: #e6e600;
  --danger: #ff3333;
  --border: #ffff00;
}

body[data-theme="oceano"] {
  background: #e6f4f9;
  color: #073b4c;
  --card-bg: #ffffff;
  --accent: #118ab2;
  --accent-hover: #0d6f8f;
  --danger: #ef476f;
  --border: #cfe9f3;
}

body[data-theme="sepia"] {
  background: #f4ecd8;
  color: #3b2f1e;
  --card-bg: #fbf3e3;
  --accent: #a0774b;
  --accent-hover: #8a6440;
  --danger: #c0392b;
  --border: #e3d5b8;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-wrapper {
  position: relative;
}

#themeSelector {
  appearance: none;
  padding: 10px 36px 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: inherit;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}

.theme-wrapper::after {
  content: '🎨';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ===== MAIN ===== */
main {
  max-width: 700px;
  margin: 30px auto;
  padding: 0 20px;
}

.record-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

#recordBtn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.2s, background 0.3s;
}

#recordBtn:hover {
  transform: scale(1.06);
  background: var(--accent-hover);
}

#recordBtn.recording {
  animation: pulse 1.2s infinite;
  background: var(--danger);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  70% { box-shadow: 0 0 0 20px rgba(231,76,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

#status {
  font-size: 14px;
  opacity: 0.7;
}

/* ===== NOTAS ===== */
#notesList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#notesList li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  animation: fadeIn 0.4s ease;
}

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

.note-content {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.note-date {
  font-size: 12px;
  opacity: 0.55;
  margin-bottom: 10px;
  display: block;
}

.note-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.note-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.note-actions button:hover {
  background: var(--border);
}

.note-actions textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
  background: var(--card-bg);
  color: inherit;
}

.save-edit-btn {
  background: var(--accent) !important;
  color: white !important;
}
