@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   60-30-10 LIGHT THEME DESIGN SYSTEM
   Dominant 60%: Soft Slate Light Background (#F8FAFC)
   Secondary 30%: Crisp Pure White Surface (#FFFFFF, #F1F5F9)
   Accent 10%: Android Emerald Green & Vibrant Tech Cyan (#10B981, #0284C7)
   ========================================================================== */

:root {
  --bg-dominant: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --accent-primary: #10B981;
  --accent-primary-hover: #059669;
  --accent-light: #D1FAE5;
  
  --accent-blue: #0284C7;
  --accent-blue-light: #E0F2FE;
  
  --accent-admin: #4F46E5;
  --accent-admin-hover: #4338CA;
  --accent-admin-light: #EEF2FF;

  --border-color: #E2E8F0;
  --border-focus: #10B981;
  
  --danger-color: #EF4444;
  --danger-light: #FEE2E2;
  --warning-color: #F59E0B;
  --warning-light: #FEF3C7;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  
  --font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dominant);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

.admin-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

/* Header Navbar */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.brand-tag {
  background: var(--accent-light);
  color: var(--accent-primary-hover);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-family);
  font-size: 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  min-height: 48px;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-primary:disabled {
  background: #CBD5E1;
  color: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-admin {
  background: linear-gradient(135deg, #4F46E5, #4338CA);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-admin:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338CA, #3730A3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #E2E8F0;
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

/* Step Cards & Flow */
.tester-info-box {
  background: var(--bg-tertiary);
  border: 1.5px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.tester-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent-primary-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1877F2;
  color: #FFFFFF;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Stats Dashboard Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-primary-hover);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Badges & Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success {
  background: var(--accent-light);
  color: #047857;
}

.badge-warning {
  background: var(--warning-light);
  color: #B45309;
}

.badge-danger {
  background: var(--danger-light);
  color: #B91C1C;
}

.badge-info {
  background: var(--accent-blue-light);
  color: #0369A1;
}

/* Upload Area */
.upload-dropzone {
  border: 2px dashed #94A3B8;
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  background: #FAF5FF;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-item {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #000;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-weight: 700;
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Admin Matrix Table */
.matrix-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  background: #FFF;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.matrix-table th, .matrix-table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.matrix-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-main);
  position: sticky;
  top: 0;
}

.matrix-table td.cell-tester {
  text-align: left;
  font-weight: 600;
  background: var(--bg-secondary);
  position: sticky;
  left: 0;
  z-index: 10;
}

.day-cell {
  cursor: pointer;
  transition: background 0.15s ease;
}

.day-cell:hover {
  filter: brightness(0.95);
}

.day-status-complete {
  background: #D1FAE5;
  color: #065F46;
  font-weight: 700;
}

.day-status-partial {
  background: #FEF3C7;
  color: #92400E;
  font-weight: 600;
}

.day-status-empty {
  background: #F8FAFC;
  color: #94A3B8;
}

/* Progress bar */
.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #0284C7);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Notice / Alert */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-warning {
  background: var(--warning-light);
  color: #B45309;
  border: 1px solid #FCD34D;
}

.alert-info {
  background: var(--accent-blue-light);
  color: #0369A1;
  border: 1px solid #7DD3FC;
}

.alert-danger {
  background: var(--danger-light);
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  margin-top: auto;
}

/* Admin Card View Layout */
.tester-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tester-card-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tester-card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.day-pill-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.day-pill {
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.day-pill:hover {
  transform: scale(1.05);
}

.day-pill-complete {
  background: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}

.day-pill-partial {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}

.day-pill-empty {
  background: #F8FAFC;
  color: #94A3B8;
}

/* View switcher tab active */
.btn-view-toggle.active {
  background: var(--accent-admin);
  color: #FFFFFF;
  border-color: var(--accent-admin);
}

/* Media Queries for Desktop responsiveness */
@media (min-width: 768px) {
  .app-container {
    padding: 32px 16px;
  }
  .form-row {
    display: flex;
    gap: 16px;
  }
  .form-row .form-group {
    flex: 1;
  }
}

