@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
}

:root {
  --bg-primary: #f4f4f5;
  --bg-card: #ffffff;
  --text-primary: #000000;
  --text-secondary: #71717a;
  --accent: #18181b;
  --border: #e4e4e7;
  --nav-bg: #000000;
  --nav-icon: #ffffff;
  --nav-icon-active: #a1a1aa;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --bg-primary: #000000;
  --bg-card: #18181b;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --accent: #ffffff;
  --border: #27272a;
  --nav-bg: #27272a;
  --nav-icon: #71717a;
  --nav-icon-active: #ffffff;
  --shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-bottom: 100px;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

#welcome-screen,
#onboarding-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.welcome-content {
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 10px;
}

.welcome-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.dev-credit {
  margin-top: 30px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dev-credit a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--text-primary);
}

#onboarding-screen {
  flex-direction: column;
  padding: 20px;
}

.carousel-container {
  width: 100%;
  max-width: 600px;
  height: 60vh;
  position: relative;
  overflow: hidden;
}

.carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transform: translateX(20px);
  pointer-events: none;
  padding: 20px;
}

.carousel-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.carousel-slide h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.carousel-slide p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.nav-arrow {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-arrow:hover {
  background-color: var(--border);
}

.carousel-dots {
  display: flex;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border);
  transition: background-color 0.3s;
}

.dot.active {
  background-color: var(--text-primary);
}

.primary-btn {
  background-color: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 16px 48px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-align: center;
}

.primary-btn:active {
  transform: scale(0.95);
}

.main-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -1px;
}

.date-display {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.main-page {
  display: none;
  padding: 24px;
  animation: fadeIn 0.4s ease;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.main-page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  margin-bottom: 32px;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hero-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0;
}

.hero-section p {
  color: var(--text-secondary);
}

.icon-btn-ghost {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

.icon-btn-ghost:hover {
  background-color: var(--border);
}

.kaizen-card {
  background-color: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
}

.status-dot.active {
  background-color: #0000;
}

.status-text {
  color: #ccc;
}

.input-group {
  position: relative;
  display: block;
}

textarea {
  width: 100%;
  background-color: transparent;
  border: none;
  border-radius: 12px;
  padding: 1rem;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--text-primary);
  resize: none;
  height: 100px;
  outline: none;
  display: block;
}

textarea:focus {
  border-color: var(--accent);
}

textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.action-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: var(--accent);
  color: var(--bg-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 10;
}

.action-btn:active {
  transform: scale(0.95);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.history-item {
  background-color: var(--bg-card);
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.history-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.history-text {
  font-weight: 500;
}

.settings-container {
  background-color: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.setting-item {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.setting-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: var(--bg-card);
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.danger-btn {
  background-color: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.danger-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.credits {
  text-align: center;
  margin-top: 40px;
  color: var(--text-secondary);
}

.bottom-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.nav-container {
  background-color: var(--nav-bg);
  border-radius: 40px;
  padding: 12px 32px;
  display: flex;
  gap: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  align-items: center;
}

.nav-item {
  color: var(--nav-icon);
  opacity: 0.5;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-item.active {
  opacity: 1;
  color: var(--nav-icon-active);
  transform: translateY(-2px);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
  transform: scale(0.95);
}

.modal-content h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
  transition: background-color 0.2s;
}

.secondary-btn:hover {
  background-color: var(--border);
}

.danger-btn-filled {
  background: #ef4444;
  border: 1px solid #ef4444;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
  transition: background-color 0.2s;
}

.danger-btn-filled:hover {
  background-color: #dc2626;
}

.history-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.header-icon-btn:hover {
  background-color: var(--border);
}

.chart-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  background-color: var(--bg-card);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
}

.filter-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.filter-btn.active {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.chart-info-header {
  text-align: center;
  margin-bottom: 16px;
}

#chart-year-label {
  font-size: 1.2rem;
  font-weight: 800;
}

.chart-wrapper {
  background-color: var(--bg-card);
  padding: 16px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  position: relative;
  height: 250px;
  width: 100%;
  border: 1px solid var(--border);
}

.chart-stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-stat-box {
  background-color: var(--bg-card);
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.stat-label-sm {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value-lg {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.chart-stat-box small {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.chart-day-detail {
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  border-left: 4px solid var(--accent);
  animation: fadeIn 0.3s;
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.chart-day-detail h4 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.chart-day-detail p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 0;
}

.calendar-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.calendar-card .card-header {
  padding: 20px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.calendar-inline-container {
  overflow-y: auto;
  padding: 20px 24px;
}

.month-block {
  margin-bottom: 30px;
}

.month-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-square {
  aspect-ratio: 1;
  background-color: var(--bg-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.day-square.past {
  opacity: 0.5;
  pointer-events: none;
  background-color: var(--border);
}

.day-square.completed {
  background-color: #000 !important;
  color: white;
  opacity: 1 !important;
}

.day-square.past.completed {
  opacity: 0.8 !important;
}

.day-square.future {
  opacity: 0.2;
  pointer-events: none;
  border: 1px dashed var(--border);
  background-color: transparent;
}

.day-square.today {
  border: 2px solid var(--text-primary);
  font-weight: 800;
  cursor: pointer;
  background-color: var(--bg-card);
}
.day-square.today:hover {
  background-color: var(--border);
}

.day-square.today.completed {
  background-color: #000;
  border-color: #000;
  color: white;
}
