/* ============================================
   ALAMETİ FABRİKA - Industrial Theme Styles
   ============================================ */

:root {
  --bg-dark: #1a1a1a;
  --bg-darker: #111;
  --bg-panel: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-dim: #888;
  --warning-yellow: #ffd700;
  --danger-red: #ff3333;
  --approved-green: #00ff00;
  --terminal-green: #33ff33;
  --steel-grey: #555;
  --belt-brown: #5a4a3a;
  --accent-orange: #ff8800;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Roboto Condensed', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============================================
   BOOT SCREEN
   ============================================ */

#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.terminal {
  width: 90%;
  max-width: 700px;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--terminal-green);
  line-height: 1.6;
  text-shadow: 0 0 8px rgba(51, 255, 51, 0.5);
}

.terminal .line {
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal .cursor {
  animation: blink 0.6s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Scanline overlay for CRT feel */
#boot-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
}

/* ============================================
   FACTORY INTERFACE
   ============================================ */

#factory-interface {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* Warning Beacons */
.beacon {
  position: fixed;
  top: 20px;
  width: 30px;
  height: 30px;
  background: var(--danger-red);
  border-radius: 50%;
  opacity: 0;
  z-index: 50;
  box-shadow: 0 0 20px var(--danger-red);
}

.beacon-left { left: 20px; }
.beacon-right { right: 20px; }

.beacon.active {
  animation: beacon-flash 0.5s ease-in-out infinite alternate;
}

@keyframes beacon-flash {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.1); }
}

/* Header */
.factory-header {
  text-align: center;
  padding: 30px 0 20px;
}

.factory-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  color: var(--warning-yellow);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.factory-header .subtitle {
  font-size: 0.95rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

.header-stripe {
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--warning-yellow) 0px,
    var(--warning-yellow) 20px,
    var(--bg-dark) 20px,
    var(--bg-dark) 40px
  );
  margin: 10px 0;
}

/* ============================================
   DASHBOARD GAUGES
   ============================================ */

.dashboard {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.gauge {
  text-align: center;
}

.gauge-body {
  width: 100px;
  height: 50px;
  background: var(--bg-panel);
  border: 2px solid var(--steel-grey);
  border-radius: 100px 100px 0 0;
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, var(--approved-green), var(--warning-yellow), var(--danger-red));
  transition: height 0.5s ease;
}

.gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 45px;
  background: var(--danger-red);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-70deg);
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 2;
  border-radius: 2px;
}

.gauge-center {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--steel-grey);
  border-radius: 50%;
  z-index: 3;
}

.gauge-label {
  display: block;
  margin-top: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  color: var(--warning-yellow);
  letter-spacing: 2px;
}

.gauge-needle.wobble {
  animation: gauge-wobble 0.3s ease-in-out;
}

@keyframes gauge-wobble {
  0%, 100% { transform: translateX(-50%) rotate(var(--target-deg)); }
  25% { transform: translateX(-50%) rotate(calc(var(--target-deg) + 5deg)); }
  75% { transform: translateX(-50%) rotate(calc(var(--target-deg) - 5deg)); }
}

/* ============================================
   CONTROL PANEL
   ============================================ */

.control-panel {
  text-align: center;
  margin: 30px 0;
}

.warning-banner {
  background: repeating-linear-gradient(
    -45deg,
    var(--warning-yellow) 0px,
    var(--warning-yellow) 10px,
    #222 10px,
    #222 20px
  );
  color: #000;
  font-weight: 700;
  padding: 10px 20px;
  font-size: 0.9rem;
  margin-bottom: 25px;
  border-radius: 4px;
}

.warning-banner span {
  background: var(--warning-yellow);
  padding: 2px 8px;
}

#start-button {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 6px solid #cc0000;
  background: radial-gradient(circle at 35% 35%, #ff4444, #cc0000 60%, #880000);
  cursor: pointer;
  box-shadow:
    0 8px 0 #660000,
    0 10px 20px rgba(0, 0, 0, 0.5),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
  animation: button-pulse 2s ease-in-out infinite;
}

#start-button:hover {
  transform: scale(1.05);
  box-shadow:
    0 8px 0 #660000,
    0 10px 30px rgba(255, 0, 0, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3);
}

#start-button:active {
  transform: translateY(4px) scale(0.98);
  box-shadow:
    0 4px 0 #660000,
    0 6px 10px rgba(0, 0, 0, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.button-inner {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.button-label {
  margin-top: 15px;
  color: var(--text-dim);
  font-size: 0.85rem;
  animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes button-pulse {
  0%, 100% { box-shadow: 0 8px 0 #660000, 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.2); }
  50% { box-shadow: 0 8px 0 #660000, 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 0, 0, 0.4); }
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ============================================
   CONVEYOR BELT & PRODUCT
   ============================================ */

.conveyor-section {
  margin: 30px 0;
  position: relative;
}

.conveyor-belt {
  height: 20px;
  background: var(--belt-brown);
  border: 2px solid var(--steel-grey);
  overflow: hidden;
  position: relative;
}

.belt-surface {
  width: 200%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--belt-brown) 0px,
    var(--belt-brown) 25px,
    #4a3a2a 25px,
    #4a3a2a 27px
  );
}

.belt-surface.moving {
  animation: conveyor-move 1s linear infinite;
}

@keyframes conveyor-move {
  from { transform: translateX(0); }
  to { transform: translateX(-27px); }
}

.product-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  position: relative;
  min-height: 350px;
}

.product-container {
  position: relative;
  display: inline-block;
  border: 4px solid var(--steel-grey);
  background: var(--bg-panel);
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#product-image {
  display: block;
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  filter: blur(15px) brightness(0.7);
  transition: filter 0.8s ease;
}

#product-image.revealed {
  filter: blur(0) brightness(1);
}

/* Scan Laser */
.scan-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--danger-red);
  box-shadow: 0 0 15px var(--danger-red), 0 0 40px rgba(255, 0, 0, 0.5);
  opacity: 0;
  z-index: 5;
}

.scan-laser.active {
  opacity: 1;
  animation: scan-laser 1s ease-in-out;
}

@keyframes scan-laser {
  0% { top: 0; opacity: 1; }
  100% { top: 100%; opacity: 1; }
}

/* Stamp Overlay */
.stamp-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  transform: scale(3) rotate(-15deg);
  transform-origin: top left;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: var(--approved-green);
  border: 3px solid var(--approved-green);
  padding: 2px 12px;
  border-radius: 6px;
  opacity: 0;
  z-index: 10;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
  pointer-events: none;
}

.stamp-overlay.slam {
  animation: stamp-slam 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes stamp-slam {
  0% {
    opacity: 0;
    transform: scale(3) rotate(-15deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.9) rotate(-15deg);
  }
  80% {
    transform: scale(1.05) rotate(-15deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-15deg);
  }
}

/* Steam Effects */
.steam {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
}

.steam-left { left: 10px; }
.steam-right { right: 10px; }

.steam.active {
  opacity: 1;
}

.steam-particle {
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(200, 200, 200, 0.6), transparent);
  border-radius: 50%;
}

.steam.active .steam-particle {
  animation: steam-rise 1.5s ease-out infinite;
}

.steam.active .steam-particle:nth-child(2) {
  animation-delay: 0.5s;
}

.steam.active .steam-particle:nth-child(3) {
  animation-delay: 1s;
}

@keyframes steam-rise {
  0% {
    opacity: 0.8;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(2);
  }
}

/* Screen Shake */
.screen-shake {
  animation: screen-shake 0.4s ease-in-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-8px, 4px); }
  20% { transform: translate(8px, -4px); }
  30% { transform: translate(-6px, 6px); }
  40% { transform: translate(6px, -2px); }
  50% { transform: translate(-4px, 2px); }
  60% { transform: translate(4px, -4px); }
  70% { transform: translate(-2px, 4px); }
  80% { transform: translate(2px, -2px); }
  90% { transform: translate(-2px, 2px); }
}

/* ============================================
   STATUS DISPLAY
   ============================================ */

.status-display {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: var(--bg-panel);
  border: 1px solid var(--steel-grey);
  border-radius: 6px;
}

.status-text {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--terminal-green);
  margin-bottom: 12px;
  min-height: 1.6em;
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: var(--bg-darker);
  border: 2px solid var(--steel-grey);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--approved-green), var(--warning-yellow));
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0px,
    transparent 8px,
    rgba(0, 0, 0, 0.15) 8px,
    rgba(0, 0, 0, 0.15) 16px
  );
  animation: progress-stripe 0.5s linear infinite;
}

@keyframes progress-stripe {
  from { background-position: 0 0; }
  to { background-position: 16px 0; }
}

.progress-label {
  margin-top: 6px;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--text-dim);
}

/* ============================================
   QUALITY METRICS
   ============================================ */

.quality-metrics {
  margin: 25px 0;
  padding: 20px;
  background: var(--bg-panel);
  border: 2px solid var(--warning-yellow);
  border-radius: 6px;
}

.quality-metrics h2 {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--warning-yellow);
  text-align: center;
  margin-bottom: 15px;
  letter-spacing: 3px;
  font-size: 1.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric {
  padding: 12px;
  background: var(--bg-darker);
  border: 1px solid var(--steel-grey);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.4s ease;
}

.metric.visible {
  opacity: 1;
  transform: translateX(0);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.metric-value.approved { color: var(--approved-green); }
.metric-value.high { color: var(--accent-orange); }
.metric-value.extreme { color: var(--danger-red); }
.metric-value.maximum { color: var(--warning-yellow); }

/* ============================================
   CERTIFICATE
   ============================================ */

.certificate {
  margin: 30px 0;
  animation: fade-in 1s ease;
}

.certificate-border {
  border: 4px double var(--warning-yellow);
  border-radius: 8px;
  padding: 4px;
}

.certificate-inner {
  border: 1px solid var(--warning-yellow);
  border-radius: 6px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-darker));
  position: relative;
}

.cert-emblem {
  font-size: 3rem;
  margin-bottom: 10px;
}

.certificate-inner h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--warning-yellow);
  letter-spacing: 4px;
}

.cert-line {
  height: 1px;
  background: var(--warning-yellow);
  margin: 15px 40px;
  opacity: 0.5;
}

.cert-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  max-width: 500px;
  margin: 0 auto;
}

.cert-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-quote {
  margin-top: 20px;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.cert-stamp {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: var(--approved-green);
  border: 3px solid var(--approved-green);
  padding: 2px 12px;
  transform: rotate(12deg);
  border-radius: 4px;
  opacity: 0.7;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 25px 0 40px;
  flex-wrap: wrap;
}

.action-btn {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 28px;
  border: 2px solid var(--warning-yellow);
  background: transparent;
  color: var(--warning-yellow);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.action-btn:hover {
  background: var(--warning-yellow);
  color: var(--bg-dark);
}

/* ============================================
   CONFETTI
   ============================================ */

#confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .factory-header h1 {
    font-size: 2.2rem;
    letter-spacing: 3px;
  }

  #start-button {
    width: 150px;
    height: 150px;
  }

  .button-inner {
    font-size: 1.1rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    gap: 20px;
  }

  #product-image {
    max-width: 220px;
    max-height: 220px;
  }

  .stamp-overlay {
    font-size: 1.2rem;
  }

  .cert-details {
    flex-direction: column;
    text-align: center;
  }
}
