/* Suitsupply Daily Game Plan - White Theme */

/* Prevent flash of unstyled content and smooth transitions */
html {
  background: #ffffff;
}

html, body {
  /* Smooth rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root {
  --font-scale: 1.08; /* 16px base */
  --primary: #000000;
  --primary-hover: #333333;
  --primary-rgb: 0, 0, 0;
  --secondary: #666666;
  --accent: #c4a77d;
  --background: #ffffff;
  --surface: #f8f8f8;
  --surface-hover: #f0f0f0;
  --border: #e0e0e0;
  --border-dark: #cccccc;
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #999999;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-size: calc(16px * var(--font-scale));
  opacity: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header
   NOTE: Keep this aligned with `public/css/shared-header.css` to prevent layout "blinking"
   while CSS loads (FOUC/layout shift). Avoid high-specificity selectors that override shared-header. */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  justify-self: start;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 24px;
  width: auto;
}

.logo-text {
  font-weight: 700;
  font-size: calc(18px * var(--font-scale));
  color: var(--text-primary);
  letter-spacing: 1px;
}

.header-title h1 {
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
}

.header-title .location {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-secondary);
  line-height: 1.1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: center;
}

.header-nav a {
  white-space: nowrap;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: calc(13px * var(--font-scale));
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.header-nav a:hover {
  color: var(--text-primary);
}

.header-nav a.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.header-date {
  font-size: calc(12px * var(--font-scale));
  color: var(--text-secondary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

.header-user:hover {
  background: var(--surface);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: calc(14px * var(--font-scale));
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-dark);
}

.btn-outline:hover {
  background: var(--surface);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Cards */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--background);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Input Groups */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-control {
  flex: 1;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface);
}

.table tr:hover {
  background: var(--surface);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-secondary {
  background: var(--surface);
  color: var(--text-secondary);
}

/* Employee Cards */
.employee-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.employee-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow);
}

.employee-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

.employee-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Metrics */
.metric-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.metric-card.highlight {
  background: var(--primary);
  color: #fff;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card.highlight .metric-label {
  color: rgba(255, 255, 255, 0.7);
}

.metric-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
}

.metric-change.positive {
  color: var(--success);
}

.metric-change.negative {
  color: var(--danger);
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.section-count {
  background: var(--surface);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

/* Screen reader only text */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--background);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: var(--success);
}

.notification.error {
  background: var(--danger);
}

.notification.warning {
  background: var(--warning);
  color: #000;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Grid System */
.grid {
  display: grid;
  gap: 16px;
}

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

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

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--danger); }

/* Last Updated */
.last-updated {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.last-updated.recent {
  color: var(--success);
}

.last-updated.stale {
  color: var(--warning);
}
