/* Tailwind CSS v4 */
@layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities) important;

/* CSS Custom Properties for theming */
:root {
  --bg: #f5f5f0;
  --card: #ffffff;
  --text: #111111;
  --text-muted: #666666;
  --border: #e5e5e5;
  --primary: #000000;
  --primary-fg: #ffffff;
}

html.dark {
  --bg: #0a0a0a;
  --card: #1a1a1a;
  --text: #ffffff;
  --text-muted: #aaaaaa;
  --border: #333333;
  --primary: #ffffff;
  --primary-fg: #000000;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

/* App root and all routed page components fill height */
app-root,
app-catalog,
app-my-courses,
app-course-viewer,
app-course-editor,
app-auth {
  display: block;
  height: 100%;
}

/* Smooth transitions for theme changes */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Override NZ-ZORRO for dark mode */
html.dark .ant-input,
html.dark .ant-select-selector,
html.dark nz-input-group {
  background-color: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html.dark .ant-input::placeholder {
  color: var(--text-muted) !important;
}

/* Page container — the ONLY scrollable element */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
}

/* Card styles */
.mc-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

/* Input styles */
.mc-input {
  width: 100%;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.mc-input:focus {
  border-color: var(--primary);
}

/* Button styles */
.mc-btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.mc-btn-primary:hover {
  opacity: 0.85;
}

/* Progress bar */
.mc-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.mc-progress-fill {
  height: 100%;
  background-color: #1abc9c;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
