/* Timerist Design System - shadcn/ui based */
/* Compatible with static HTML pages */
/* Load shared/css/themes.css first for RGB vars; this provides utility classes. */

/* Timerist accent (optional – use for timer digits and primary actions) */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-header: clamp(1rem, 3vw, 1.25rem);
  --font-weight-header: 600;

  --timer-primary: 212 90% 59%;   /* blue #4A90E2 */
  --timer-success: 142 69% 55%;   /* green for Clear / success */
  --timer-phase: 0 0% 45.1%;      /* muted for WORK/REST phase label */
  
  /* Shadows */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Utility Classes - use rgb(var(--x)) for timer pages with themes.css */
.bg-background { background-color: rgb(var(--background)); }
.bg-card { background-color: rgb(var(--card)); }
.bg-primary { background-color: rgb(var(--primary)); }
.bg-secondary { background-color: rgb(var(--secondary)); }
.bg-destructive { background-color: rgb(var(--destructive)); }
.bg-muted { background-color: rgb(var(--muted)); }
.bg-accent { background-color: rgb(var(--accent)); }

.text-foreground { color: rgb(var(--foreground)); }
.text-card-foreground { color: rgb(var(--card-foreground)); }
.text-primary { color: rgb(var(--primary)); }
.text-primary-foreground { color: rgb(var(--primary-foreground)); }
.text-secondary { color: rgb(var(--secondary)); }
.text-secondary-foreground { color: rgb(var(--secondary-foreground)); }
.text-muted-foreground { color: rgb(var(--muted-foreground)); }
.text-destructive { color: rgb(var(--destructive)); }
.text-destructive-foreground { color: rgb(var(--destructive-foreground)); }

.border { border: 1px solid rgb(var(--border)); }
.border-border { border-color: rgb(var(--border)); }
.border-primary { border-color: rgb(var(--primary)); }
.border-destructive { border-color: rgb(var(--destructive)); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: calc(var(--radius) + 2px); }
.rounded-md { border-radius: var(--radius); }
.rounded-sm { border-radius: calc(var(--radius) - 2px); }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-large); }
.shadow-hover:hover { box-shadow: var(--shadow-hover); }

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  padding: 0.5rem 1rem;
  min-height: 44px;
  min-width: 44px;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: rgb(var(--primary));
  color: rgb(var(--primary-foreground));
}

.btn-primary:hover:not(:disabled) {
  background-color: rgba(var(--primary), 0.9);
}

.btn-secondary {
  background-color: rgb(var(--secondary));
  color: rgb(var(--secondary-foreground));
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(var(--secondary), 0.9);
}

.btn-destructive {
  background-color: rgb(var(--destructive));
  color: rgb(var(--destructive-foreground));
}

.btn-destructive:hover:not(:disabled) {
  background-color: rgba(var(--destructive), 0.9);
}

/* Card Styles */
.card {
  background-color: rgb(var(--card));
  color: rgb(var(--card-foreground));
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* Input Styles */
.input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--input));
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.input:focus {
  outline: none;
  border-color: rgb(var(--ring));
  box-shadow: 0 0 0 2px rgba(var(--ring), 0.2);
}

/* Responsive Grid */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 768px) {
  .grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* Spacing */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-7xl { font-size: 4.5rem; }
.text-8xl { font-size: 6rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }

/* Mode Toggle */
.mode-toggle {
  position: relative;
  z-index: 1001;
}

.mode-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--border));
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
  font-size: 1.25rem;
}

.mode-toggle-btn:hover {
  background-color: rgb(var(--accent));
}

/* Header actions container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Hidden/Visible */
.hidden { display: none; }
