/* ============================================
   SHUTTERCRIT - Shared App Styles
   Extends landing page design system
   ============================================ */

/* Self-hosted fonts (latin subset) */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/dmsans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dmsans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/oxanium-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eef1f5;
  --text-primary: #0d1117;
  --text-secondary: #24292f;
  --text-muted: #57606a;
  --text-light: #6e7681;
  --accent: #D64C00;
  --accent-hover: #ff6b1f;
  --accent-dark: #a33c00;
  --accent-light: #fef0e9;
  --success: #1a7f37;
  --success-light: #dafbe1;
  --warning: #9a6700;
  --warning-light: #fff8c5;
  --danger: #cf222e;
  --danger-light: #ffebe9;
  --border: #d0d7de;
  --border-light: #e8eaed;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Oxanium', monospace;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---- LOGO (standalone, works anywhere) ---- */
.logo {
  font-family: 'Oxanium', monospace;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

/* ---- LAYOUT ---- */
.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

.app-container.wide {
  max-width: 960px;
}

/* ---- APP NAV ---- */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}

/* .app-nav .logo inherits from standalone .logo above */

.app-nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
  list-style: none;
}

.app-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

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

.app-nav-links .active { color: var(--accent); }

/* ---- CARDS ---- */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: 24px;
}

.card-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.card-header h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(214, 76, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
}

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

.btn-success:hover:not(:disabled) {
  opacity: 0.9;
}

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

.btn-danger:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 76, 0, 0.1);
}

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

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.badge-processing {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-ready {
  background: var(--success-light);
  color: var(--success);
}

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

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-primary);
}

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

.upload-zone svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-light);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 12px;
}

.upload-zone.dragover svg {
  stroke: var(--accent);
}

.upload-zone h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

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

/* ---- PHOTO GRID ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb .photo-number {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ---- ORDER CARD ---- */
.order-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.order-card:hover {
  box-shadow: var(--shadow-sm);
}

.order-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.order-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.order-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.order-actions {
  flex-shrink: 0;
}

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

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

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* ---- LOADING ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ---- AUTH PAGE ---- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .logo {
  font-size: 28px;
  text-align: center;
  display: block;
  margin-bottom: 32px;
}

.auth-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin: 24px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border-light);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--border);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .app-container {
    padding: 16px;
  }

  .card {
    padding: 20px;
  }

  .card-header h1 {
    font-size: 24px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .order-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .order-thumb {
    width: 100%;
    height: 120px;
  }
}

/* ---- PRINT STYLES (for review page) ---- */
@media print {
  body {
    background: #fff;
    font-size: 12pt;
  }

  .app-nav,
  .no-print,
  .btn {
    display: none !important;
  }

  .app-container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    border: none;
    box-shadow: none;
    padding: 0;
    break-inside: avoid;
  }
}
