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

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:            #fffbf8;
  --surface:       #FFFFFF;
  --surface2:      #F0ECE5;
  --surface3:      #E8E2D9;
  --text:          #775537;
  --text2:         #775537;
  --text3:         #775537;
  --border:        rgba(119, 85, 55, 0.15);
  --border2:       rgba(119, 85, 55, 0.30);
  --accent:        #facb4f;
  --accent-dark:   #e8b43a;
  --accent-light:  #fef3d0;
  --accent-light2: #EDD9C4;
  --danger:        #B84040;
  --danger-light:  #FAEAEA;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:     6px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.12);
  --font-display:  "Lora", serif;
  --font-body:     "Lora", serif;
  --transition:    0.2s ease;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Body ─ */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

.app-drag-region {
  -webkit-app-region: drag;
  height: 28px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}

/* ── Container ── */
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 52px 28px 80px;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 44px;
  animation: fadeUp 0.5s ease both;
}

.date-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #775537;
  margin-bottom: 12px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 300;
  font-style: italic;
  color: #ff8686;
  line-height: 1.15;
}

h1 span {
  color: var(--accent);
}

.feelings-section {
  margin-bottom: 36px;
  animation: fadeUp 0.5s 0.08s ease both;
}

.feelings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 540px) {
  .feelings-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Feeling Card ── */
.feeling-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform 0.15s ease,
    box-shadow var(--transition);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.feeling-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feeling-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feeling-card.selected {
  border-color: var(--accent);
  background: #dee175;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feeling-card.selected::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff8686;
}

/* ── Icon ── */
.icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.feeling-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  /* Quita el fondo negro de los PNGs */
  mix-blend-mode: multiply;
  border-radius: 50%;
  display: block;
  transition: transform 0.2s ease;
}

/* Hover: pequeño rebote */
.feeling-card:hover .feeling-img {
  animation: pulse 0.5s ease;
}

/* Seleccionado: flota suavemente */
.feeling-card.selected .feeling-img {
  animation: float 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* ── Feeling Name ── */
.feeling-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

/* ── Text Columns ── */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s 0.14s ease both;
}

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

.col-block {
  display: flex;
  flex-direction: column;
  gap: 10px;

}

.col-label {
  font-size: 20px;
  font-weight: 200;
  letter-spacing: 0.12em;
  color: var(--text3);
  display: block;
  text-align: center;
}

textarea {
  width: 100%;
  min-height: 148px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.7;
}

textarea::placeholder {
  color: var(--text3);
  font-style: italic;
}

textarea:focus {
  border-color: var(--accent);
}

/* ── Save Row ─────────────────────────────────────────────────────────────── */
.save-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 64px;
  animation: fadeUp 0.5s 0.18s ease both;
}

.save-msg {
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.4s;
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 15px;
}

.save-msg.visible {
  opacity: 1;
}

.btn-save {
  background: #ff8686;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 48px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.btn-save:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-save:active {
  transform: scale(0.97);
}

/* ── Past Entries ─────────────────────────────────────────────────────────── */
.past-entries {
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.past-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

h2.past-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  color: var(--text2);
}

.btn-ghost {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.btn-ghost:hover {
  color: var(--text2);
  background: var(--surface2);
}

/* ── Entry Item ───────────────────────────────────────────────────────────── */
.entry-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
  position: relative;
}

.entry-item:hover {
  border-color: var(--border2);
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.entry-feeling-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.entry-date {
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
  letter-spacing: 0.06em;
}

.entry-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}

.entry-item:hover .entry-actions {
  opacity: 1;
}

.btn-delete {
  font-size: 11px;
  color: var(--text3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-light);
}

.entry-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

@media (max-width: 480px) {
  .entry-body { grid-template-columns: 1fr; }
}

.entry-text-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.entry-text-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text3);
}

.entry-text-content {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── Empty state ── */
.no-entries {
  font-size: 14px;
  color: var(--text3);
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 300;
  text-align: center;
  padding: 32px 0;
}

/* ── Toast / path info ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--surface3);
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 12px;
  max-width: 480px;
  width: calc(100% - 48px);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  word-break: break-all;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-item {
  animation: fadeUp 0.3s ease both;
}
