/* ===== HabitFlow custom styles ===== */

#prophet-toast {
  transform: translate(-50%, -150%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  pointer-events: none;
}
#prophet-toast.show-toast {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* Matrix table */
.matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 900px;
  font-size: 12px;
}
.matrix-table th, .matrix-table td {
  text-align: center;
  padding: 4px 3px;
  white-space: nowrap;
}
.matrix-table thead th {
  background: #11322A;
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.matrix-table thead .week-sep, .matrix-table tbody .week-sep {
  border-left: 2px solid #d1e7dd;
}
.matrix-table tbody tr:nth-child(even) td { background: #F2F6F5; }
.matrix-table tbody tr:nth-child(odd) td { background: #ffffff; }
.matrix-table tbody tr:hover td { background: #E6F4EE; }

.habit-name-cell {
  text-align: right !important;
  font-weight: 700;
  font-size: 13px;
  padding-right: 10px !important;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  position: sticky;
  right: 0;
  z-index: 5;
  box-shadow: -3px 0 5px rgba(0,0,0,0.03);
}
.matrix-table tbody tr:nth-child(even) .habit-name-cell { background: #F2F6F5; }
.matrix-table tbody tr:nth-child(odd) .habit-name-cell { background: #ffffff; }
.habit-name-cell:hover { color: #164036; text-decoration: underline; }

/* Checkbox cells */
.check-cell {
  width: 26px;
  height: 26px;
  cursor: pointer;
  user-select: none;
}
.check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid #cbd5d1;
  border-radius: 5px;
  background: #fff;
  transition: all .12s ease;
  font-size: 11px;
  color: transparent;
}
.check-cell:hover .check-box { border-color: #34D399; transform: scale(1.1); }
.check-box.checked {
  background: #11322A;
  border-color: #11322A;
  color: #4ADE80;
}
.check-cell.today-col .check-box { box-shadow: 0 0 0 2px #4ADE80; }
.check-cell.future { opacity: 0.35; cursor: not-allowed; }

th.today-col { background: #1E5245 !important; }
th.today-col .day-num {
  background: #4ADE80;
  color: #11322A;
  border-radius: 50%;
  display: inline-block;
  width: 18px; height: 18px; line-height: 18px;
}

/* Analysis columns */
.analysis-cell { font-weight: 700; min-width: 34px; }
.mini-bar-wrap {
  width: 60px; height: 7px;
  background: #e5eceb;
  border-radius: 99px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.mini-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #34D399, #11322A);
  border-radius: 99px;
  transition: width .3s ease;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #FFF4E5;
  color: #B45309;
  border-radius: 99px;
  padding: 1px 7px;
  font-weight: 800;
  font-size: 11px;
}

/* Month tabs (excel style) */
#month-tabs { scrollbar-width: thin; }
.month-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  border-left: 1px solid #eee;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.month-tab:hover { background: #F2F6F5; color: #11322A; }
.month-tab.active {
  background: #11322A;
  color: #fff;
  border-top: 3px solid #4ADE80;
}

/* Emoji picker */
#emoji-picker button {
  font-size: 20px;
  padding: 2px;
  border-radius: 8px;
  transition: transform .1s;
}
#emoji-picker button:hover { transform: scale(1.3); background: #E6F4EE; }
#emoji-picker button.selected { background: #11322A; }

/* Top10 list */
.top10-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F7F9F9;
  border-radius: 10px;
  padding: 6px 10px;
}
.top10-rank {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #11322A;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top10-item:nth-child(1) .top10-rank { background: #D4AF37; }
.top10-item:nth-child(2) .top10-rank { background: #9CA3AF; }
.top10-item:nth-child(3) .top10-rank { background: #B87333; }

/* Toast animation */
#toast.show { display: block; animation: toastIn .25s ease; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Scrollbars */
#matrix-wrapper::-webkit-scrollbar { height: 8px; }
#matrix-wrapper::-webkit-scrollbar-thumb { background: #cbd5d1; border-radius: 99px; }

@media (max-width: 768px) {
  .matrix-table { font-size: 11px; }
  .habit-name-cell { max-width: 120px; font-size: 12px; }
}
