/* Ko Cre8 — Component Styles */

/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: background var(--transition-base);
}

[data-theme="light"] .card {
  border: 0.5px solid var(--border-color);
}

/* === BUTTONS === */
.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  text-align: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
  width: 100%;
  display: block;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-main);
  font-size: var(--font-size-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  width: 100%;
  display: block;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* === INPUT FIELDS === */
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px var(--space-lg);
  font-family: var(--font-main);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  width: 100%;
  transition: border-color var(--transition-fast);
}

.input-field:focus {
  border-color: var(--accent);
  outline: none;
}

/* === CHIPS === */
.chip {
  display: inline-block;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.chip:hover {
  border-color: var(--border-hover);
}

.chip.active {
  background: var(--accent);
  color: #FFFFFF;
}

.chip-outline {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  cursor: pointer;
}

/* === PROGRESS BAR === */
.progress-bar {
  background: var(--bg-elevated);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #F09A78, var(--accent));
  height: 100%;
  border-radius: 999px;
  transition: width var(--transition-slow);
}

/* === ENERGY BAR === */
.energy-bar {
  background: var(--bg-elevated);
  border-radius: var(--energy-radius);
  height: var(--energy-height);
  overflow: hidden;
}

.energy-fill {
  background: linear-gradient(90deg, #F09A78, var(--accent));
  height: 100%;
  border-radius: 999px;
  transition: width var(--transition-slow);
}

/* Low energy warning */
.energy-bar.low .energy-fill {
  background: #E24B4A;
}

/* === INSIGHT CARD === */
.insight-card {
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md);
  background: var(--bg-card);
}

[data-theme="light"] .insight-card {
  border-top: 0.5px solid var(--border-color);
  border-right: 0.5px solid var(--border-color);
  border-bottom: 0.5px solid var(--border-color);
}

.insight-label {
  color: var(--accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-xs);
}

.insight-text {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

/* === CHAT BUBBLES === */
.bubble-ai {
  background: var(--bg-card);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  max-width: 82%;
  color: var(--text-primary);
}

[data-theme="light"] .bubble-ai {
  border: 0.5px solid var(--border-color);
}

.bubble-user {
  background: var(--accent);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  max-width: 80%;
  color: #FFFFFF;
  align-self: flex-end;
}

/* === KO AVATAR === */
.ko-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e46f55 url('../../public/assets/cre8-brand-icon.png?v=20260603-rounded-icon') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  color: transparent;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: none !important;
  filter: none !important;
}

.ko-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.ko-avatar-xl {
  width: 60px;
  height: 60px;
  font-size: 20px;
}

.ko-avatar-outline {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
  z-index: 100;
}

.nav-item {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: center;
  color: inherit;
  cursor: pointer;
  padding: 6px var(--space-xs);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all var(--transition-fast);
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--text-tertiary);
  transition: color var(--transition-fast), transform var(--transition-fast);
  stroke-width: 1.8;
}

.nav-item.active .nav-icon {
  color: var(--accent);
  stroke-width: 2.2;
  transform: translateY(-1px);
}

.nav-label {
  font-size: 9px;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
  font-weight: var(--font-weight-medium);
}

.nav-item.active .nav-label {
  color: var(--accent);
}

/* === UTILITY === */
.text-accent { color: var(--accent); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-center { text-align: center; }
.fw-medium { font-weight: var(--font-weight-medium); }
.fw-semi { font-weight: var(--font-weight-semibold); }
.mt-auto { margin-top: auto; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }


/* ========================================
   KO CRE8 LOGO (page headers)
   ======================================== */
.ko-logo-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.ko-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e46f55 url('../../public/assets/cre8-brand-icon.png?v=20260603-rounded-icon') center / cover no-repeat;
  border: 0;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.3px;
  flex-shrink: 0;
  overflow: hidden;
  text-indent: -999px;
  box-shadow: none !important;
  filter: none !important;
}

.ko-logo-text {
  width: 64px;
  height: 25px;
  display: block;
  color: transparent;
  text-indent: -999px;
  overflow: hidden;
  background: url('../../public/assets/cre8-logo-wordmark.png?v=20260531-brand-stable') left center / contain no-repeat;
}

.ko-logo-subtitle {
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 1px;
  letter-spacing: 0.2px;
}

/* Page header row with logo + avatar */
.page-header-with-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) 0 var(--space-md);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

/* Smaller logo for chat header (mentor) */
.chat-header .ko-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.chat-header .ko-logo-text {
  font-size: 14px;
}
