/* Hot Rod Shop Time Clock - Shared Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== Theme Variables ========== */
:root {
  /* Dark Mode (default) */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #2d3748;
  --bg-hover: #3d4a5c;
  --hover-bg: rgba(79, 209, 197, 0.05);

  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  --border-color: #2d3748;
  --border-hover: #4fd1c5;

  --accent-primary: #4fd1c5;
  --accent-primary-hover: #38b2ac;
  --accent-primary-bg: rgba(79, 209, 197, 0.15);

  --accent-success: #48bb78;
  --accent-success-bg: rgba(72, 187, 120, 0.15);

  --accent-warning: #ecc94b;
  --accent-warning-bg: rgba(236, 201, 75, 0.15);

  --accent-danger: #fc8181;
  --accent-danger-hover: #f56565;
  --accent-danger-bg: rgba(252, 129, 129, 0.15);

  --card-bg: #1a1f2e;
  --card-bg-alt: #0f1419;

  --input-bg: #0f1419;
  --input-border: #2d3748;

  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-hover: #cbd5e0;
  --hover-bg: rgba(49, 151, 149, 0.05);

  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  --border-color: #e2e8f0;
  --border-hover: #4fd1c5;

  --accent-primary: #319795;
  --accent-primary-hover: #2c7a7b;
  --accent-primary-bg: rgba(49, 151, 149, 0.1);

  --accent-success: #38a169;
  --accent-success-bg: rgba(56, 161, 105, 0.1);

  --accent-warning: #d69e2e;
  --accent-warning-bg: rgba(214, 158, 46, 0.1);

  --accent-danger: #e53e3e;
  --accent-danger-hover: #c53030;
  --accent-danger-bg: rgba(229, 62, 62, 0.1);

  --card-bg: #ffffff;
  --card-bg-alt: #f7fafc;

  --input-bg: #ffffff;
  --input-border: #e2e8f0;

  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

/* Layout */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

.container.wide {
  max-width: 1000px;
}

/* Top Nav Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s, border-color 0.3s;
}

.top-nav .nav-left,
.top-nav .nav-right {
  display: flex;
  gap: 12px;
}

.top-nav .nav-btn {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.top-nav .nav-btn:hover {
  background-color: var(--bg-hover);
}

.top-nav .nav-btn.done-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.top-nav .nav-btn.done-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.header .subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

/* Footer status bar */
.footer-bar {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  transition: background-color 0.3s, border-color 0.3s;
}

.footer-bar .datetime {
  font-weight: 500;
}

.footer-bar .help-text {
  font-size: 13px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.theme-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color 0.3s;
}

.theme-toggle:hover .theme-icon {
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: all 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-primary);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background-color: var(--bg-primary);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(79, 209, 197, 0.2);
}

.theme-toggle-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Cards and Panels */
.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 20px;
  transition: background-color 0.3s, border-color 0.3s;
}

.panel {
  background-color: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 20px;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
  padding: 16px 32px;
}

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

.btn-primary:disabled {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 16px 32px;
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

.btn-danger {
  background-color: var(--accent-danger);
  color: #ffffff;
  padding: 16px 32px;
}

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

.btn-ghost {
  background-color: transparent;
  color: var(--accent-primary);
  padding: 12px 20px;
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background-color: var(--card-bg);
  border-color: var(--accent-primary);
}

.btn-large {
  padding: 24px 40px;
  font-size: 18px;
  min-height: 80px;
}

.btn-block {
  width: 100%;
}

/* Action Cards (for technician home) */
.action-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  border: 2px solid var(--border-color);
  padding: 32px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
}

.action-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.action-card .icon {
  width: 64px;
  height: 64px;
  background-color: var(--accent-primary-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.action-card .icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
}

.action-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.action-card p {
  font-size: 14px;
  color: var(--text-muted);
}

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

/* Job List Items */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-item {
  background-color: var(--card-bg-alt);
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.job-item:hover {
  border-color: var(--accent-primary);
}

.job-item.selected {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary-bg);
}

.job-item .job-info {
  flex: 1;
}

.job-item .job-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.job-item .job-details {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.job-item .job-ops {
  font-size: 13px;
  color: var(--text-muted);
}

.job-item .select-btn {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.job-item .select-btn:hover {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

.job-item.selected .select-btn {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* Operation Items */
.op-item {
  background-color: var(--card-bg-alt);
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.op-item:hover {
  border-color: var(--accent-primary);
}

.op-item.selected {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary-bg);
}

.op-item .op-info {
  flex: 1;
}

.op-item .op-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.op-item .op-details {
  font-size: 14px;
  color: var(--text-secondary);
}

.op-item .radio {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.op-item.selected .radio {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary);
}

.op-item.selected .radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background-color: var(--bg-primary);
  border-radius: 50%;
}

/* Timer Display */
.timer-display {
  text-align: center;
  padding: 48px 24px;
}

.timer-display .time {
  font-size: 72px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.timer-display .label {
  font-size: 16px;
  color: var(--text-muted);
}

/* Context Panel (for active timer) */
.context-panel {
  background-color: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 24px;
  transition: background-color 0.3s, border-color 0.3s;
}

.context-panel .context-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.context-panel .context-row:last-child {
  border-bottom: none;
}

.context-panel .context-label {
  color: var(--text-muted);
  font-size: 14px;
}

.context-panel .context-value {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

/* Footer Navigation */
.footer-nav {
  display: flex;
  justify-content: space-between;
  padding: 20px 24px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background-color: var(--bg-hover);
}

.tab.active {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* Search Box */
.search-box {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  width: 100%;
  margin-bottom: 20px;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.search-box::placeholder {
  color: var(--text-muted);
}

.search-box:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Link Button */
.link-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.toggle {
  width: 48px;
  height: 26px;
  background-color: var(--bg-tertiary);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle.active {
  background-color: var(--accent-primary);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--text-primary);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.2s;
}

.toggle.active::after {
  left: 25px;
}

/* Confirmation Screen */
.confirm-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
}

.confirm-icon {
  width: 80px;
  height: 80px;
  background-color: var(--accent-primary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.confirm-icon.warning {
  background-color: var(--accent-warning-bg);
}

.confirm-icon svg {
  width: 40px;
  height: 40px;
  color: var(--accent-primary);
}

.confirm-icon.warning svg {
  color: var(--accent-warning);
}

.confirm-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.confirm-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
}

.confirm-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

/* Success message */
.success-box {
  background-color: var(--accent-success-bg);
  border: 1px solid var(--accent-success);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
}

.success-box .success-text {
  color: var(--accent-success);
  font-weight: 600;
  font-size: 16px;
}

/* Scrollable area */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.not-started {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.status-badge.in-progress {
  background-color: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.status-badge.completed {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex-1 { flex: 1; }
