/* ===========================
   PROMĚNNÉ
=========================== */
:root {
  --bg:        #0D0D0F;
  --surface:   #1C1C1E;
  --surface2:  #2A2A2C;
  --accent:    #F5A020;
  --accent-bg: rgba(245, 160, 32, 0.12);
  --text:      #FFFFFF;
  --text2:     rgba(255, 255, 255, 0.45);
  --text3:     rgba(255, 255, 255, 0.2);
  --border:    rgba(255, 255, 255, 0.07);
  --r:         12px;
  --sidebar-w: 220px;
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   SIDEBAR (desktop only)
=========================== */
.sidebar { display: none; }

/* ===========================
   HEADER (mobile only)
=========================== */
.header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 0.5px solid var(--border);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  user-select: none;
  color: var(--text);
}

.logo span { color: var(--accent); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
}

.icon-btn:hover { background: var(--surface2); }

/* ===========================
   MAIN
=========================== */
.main {
  flex: 1;
  overflow: hidden;
}

.page {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 18px 18px 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.page::-webkit-scrollbar { display: none; }
.page.active { display: flex; }

/* ===========================
   BOTTOM NAV (mobile only)
=========================== */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--border);
}

.bottom-nav .nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 20px;
  color: var(--text3);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.15s;
}

.bottom-nav .nav-btn i { font-size: 22px; }
.bottom-nav .nav-btn.active { color: var(--accent); }

/* ===========================
   DATUM
=========================== */
.day-name {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.day-full {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ===========================
   LABEL / FLEX-ROW
=========================== */
.label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.flex-row .label { margin-bottom: 0; }

.counter {
  font-size: 11px;
  color: var(--text3);
}

/* ===========================
   NÁLADA
=========================== */
.mood-row { display: flex; gap: 6px; }

.mood-btn {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--r);
  padding: 11px 4px 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.mood-btn span {
  font-size: 8px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.2);
}

.mood-btn:hover {
  border-color: var(--accent);
  color: var(--text2);
}

.mood-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.mood-btn.active span { color: rgba(13, 13, 15, 0.5); }

/* ===========================
   UPLOAD TLAČÍTKA
=========================== */
.upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.upload-btn i { font-size: 17px; color: var(--accent); }
.upload-btn:hover { background: var(--surface2); color: var(--text); }
.upload-btn input { display: none; }

/* ===========================
   FOTO GRID
=========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.loc-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3px 5px;
  background: rgba(13, 13, 15, 0.65);
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}

.remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(13, 13, 15, 0.65);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-item:hover .remove-btn { opacity: 1; }

/* ===========================
   ZÁPISEK
=========================== */
.note {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  outline: none;
  min-height: 90px;
  transition: border-color 0.15s;
}

.note::placeholder { color: var(--text3); }
.note:focus { border-color: var(--accent); }

.note-count {
  text-align: right;
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* ===========================
   STATUS AUTO-SAVE
=========================== */
.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  padding-bottom: 24px;
}

.save-status i { font-size: 15px; }
.save-status.saved { color: rgba(245, 160, 32, 0.6); }

/* ===========================
   KALENDÁŘ
=========================== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-title {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.3px;
}

.cal-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.cal-btn:hover { background: var(--surface2); }

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-days span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-cell.empty { background: transparent; cursor: default; border: none; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.has-entry:hover { border-color: var(--accent); }
.cal-cell img { width: 100%; height: 100%; object-fit: cover; }

.cell-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
}

.cal-cell.has-entry .cell-num {
  position: absolute;
  top: 3px; left: 4px;
  color: var(--text);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ===========================
   KOLÁŽ
=========================== */
.big-title {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.5px;
  margin-bottom: 3px;
}

.sub-title {
  font-size: 13px;
  color: var(--text3);
}

.range-row { display: flex; gap: 8px; }

.range-btn {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.range-btn:hover { background: var(--surface2); color: var(--text); }
.range-btn.active { background: var(--accent); color: var(--bg); }

.canvas {
  width: 100%;
  border-radius: var(--r);
  background: var(--surface);
  display: block;
}

.action-row { display: flex; gap: 8px; padding-bottom: 24px; }

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px;
  border-radius: var(--r);
  background: var(--surface);
  border: 0.5px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.action-btn:hover { background: var(--surface2); color: var(--text); }
.action-btn.accent { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.action-btn.accent:hover { opacity: 0.88; }

/* ===========================
   DESKTOP (≥ 768px)
=========================== */
@media (min-width: 768px) {
  body { flex-direction: row; }

  /* Skrýt mobilní prvky */
  .header     { display: none; }
  .bottom-nav { display: none; }

  /* Sidebar */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 0.5px solid var(--border);
    padding: 28px 0 20px;
  }

  .sidebar .logo {
    padding: 0 20px 28px;
    font-size: 18px;
  }

  .sidenav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
  }

  .sidenav .nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    transition: all 0.15s;
  }

  .sidenav .nav-btn i { font-size: 18px; }
  .sidenav .nav-btn:hover { background: var(--surface2); color: var(--text); }
  .sidenav .nav-btn.active { background: var(--accent-bg); color: var(--accent); }

  .side-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text3);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
  }

  .side-settings i { font-size: 18px; }
  .side-settings:hover { background: var(--surface2); color: var(--text2); }

  /* Obsah */
  .main { flex: 1; overflow: hidden; }

  .page {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 28px 0;
  }

  .day-full { font-size: 32px; }

  .grid { grid-template-columns: repeat(5, 1fr); }

  .note { min-height: 120px; }
}


/* ===========================
   MODAL DETAILU DNE
=========================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-content {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  width: 100%;
  max-width: 500px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content::-webkit-scrollbar { display: none; }

/* ===========================
   VELKÝ DESKTOP (≥ 1200px)
=========================== */
@media (min-width: 1200px) {
  :root { --sidebar-w: 260px; }

  .page { max-width: 720px; }

  .grid { grid-template-columns: repeat(6, 1fr); }
}