/* Alberta Tradesman FunZone styles */

/* Compact Hero Section */
.hero-compact {
  background: linear-gradient(135deg, #FFE66D 0%, #FF6B35 50%, #4ECDC4 100%);
  padding: 15px 20px;
  margin: 10px 0 20px 0;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-compact h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2C3E50;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.hero-compact p {
  margin: 5px 0 0 0;
  font-size: 0.95rem;
  color: #1a1a1a;
  font-style: italic;
}

/* Fun Meter Styles */
.meter-container {
  margin: 2rem 0;
  padding: 1rem;
}

.meter {
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFE66D, #FF6B35, #4ECDC4);
  transition: width 0.3s ease;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

/* Meter Controls Layout */
.meter-controls {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 15px;
}

.meter-section {
  flex: 1;
}

.meter-label {
  margin-bottom: 10px;
  font-weight: bold;
  color: #FFE66D;
}

.meter-bar {
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.output-area {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: #2C3E50;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Safety Cone Mode */
body.cone-mode {
  background: repeating-linear-gradient(
    45deg,
    #ff7a00,
    #ff7a00 20px,
    #fff 20px,
    #fff 40px
  );
}

body.cone-mode .site-header {
  background: #ff7a00 !important;
}

:root {
  --yellow: #ffd400;
  --orange: #ff7a00;
  --amber: #ffb000;
  --black: #0f1419;
  --ink: #1b1f24;
  --gray-900: #20262d;
  --gray-700: #2b323a;
  --gray-500: #626e7a;
  --paper: #f6f7f8;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: #e9edf1;
  background: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Site header styles removed - using header.css and header-nav.css instead */

/* Evasive "About the Builder" link */
.builder-link {
  color: var(--yellow, #ffd400);
  text-decoration: underline;
  font-weight: 700;
  position: relative;
  z-index: 5;
  transition: transform 120ms ease, opacity 120ms ease;
  user-select: none;
}
.builder-link:focus { outline: 2px dashed var(--yellow, #ffd400); outline-offset: 2px; }

/* Shop Valve Volume control */
.vol-valve {
  position: relative; width: 54px; height: 72px; flex: 0 0 auto;
  display: grid; place-items: center; margin-left: auto; /* push to right side */
}
.valve-knob {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ffd36b 30%, #ff9a3d 70%);
  border: 2px solid #2a3139; box-shadow: 0 6px 14px rgba(0,0,0,0.45);
  position: relative; transform: rotate(-90deg); /* initial */
  transition: transform 80ms ease;
}
.valve-handle {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 6px; background: #111; border-radius: 3px;
  transform-origin: 0% 50%; transform: translate(0, -50%) rotate(0deg);
}
.vol-valve:focus { outline: 2px dashed var(--yellow, #ffd400); outline-offset: 4px; border-radius: 10px; }
.valve-markers { position: absolute; inset: 0; pointer-events: none; }
.valve-markers::before { content: ''; position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; border-radius: 50%;
  background: conic-gradient(from 225deg, #2a3139 0 20deg, transparent 20deg 250deg, #2a3139 250deg 270deg);
  transform: translate(-50%, -50%); opacity: 0.6; filter: blur(0.2px);
}
.valve-label { position: absolute; bottom: 18px; font-size: 11px; color: #9fb3c8; letter-spacing: 0.2px; }
.valve-readout { position: absolute; bottom: 2px; font-size: 12px; color: #cfd7df; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: grid; place-items: center; z-index: 10000;
  animation: overlay-in 120ms ease;
}
@keyframes overlay-in { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: #0f1419; color: #eef3f8; border: 1px solid #2a3139; border-radius: 12px;
  width: min(900px, 96vw); padding: 20px; box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 800; margin: 0; }
.modal-close { background: transparent; border: 0; color: #cfd7df; font-size: 20px; cursor: pointer; }
.modal-body { margin-top: 8px; }
.modal-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.modal-actions a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.modal-actions a span { opacity: 0.9; font-weight: 600; }
.modal-actions a.modal-serious { background: #14202a; border: 1px solid #2a3944; color: #e6f1f7; }
.modal-actions a.modal-funny { background: #1a1f14; border: 1px solid #36402a; color: #f5f2d9; }
.modal-actions a.modal-srsfunny { background: #1e1620; border: 1px solid #46304a; color: #f8e6ff; }

/* Detail modal content */
.modal-content { display: grid; gap: 6px; margin-top: 4px; color: #cfd7df; }
.modal-content h4 { margin: 8px 0 4px; font-size: 16px; }
.modal-content p { margin: 6px 0; line-height: 1.35; }
.modal-content ul { margin: 6px 0; padding-left: 18px; }
.modal-content li { margin: 2px 0; line-height: 1.35; }
.modal-content a { color: white; text-decoration: none; }
.modal-content a:hover { text-decoration: underline; }
.modal-content.twocol { }
@media (min-width: 900px) {
  .modal-content.twocol { column-count: 2; column-gap: 24px; }
  .modal-content.twocol h4, .modal-content.twocol ul, .modal-content.twocol p { break-inside: avoid; }
}
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.modal-btn { appearance: none; border: 1px solid #2a3139; background: #171c21; color: #e9edf1; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.modal-btn.primary { background: linear-gradient(180deg, var(--amber, #ffb000), var(--orange, #ff7a00)); color: #111; border-color: #d96d00; }

/* Floating AI Assistant button (never clickable) */
.ai-float {
  position: fixed;
  left: 24px;
  top: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #ffd400 35%, #ff7a00 70%);
  color: #111;
  font-weight: 900;
  border: 2px solid #2a3139;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  z-index: 10002;
  cursor: pointer;
  display: grid;
  place-items: center;
  user-select: none;
}
.ai-float::after { content: '\1F916'; font-size: 16px; }
.ai-float:active { transform: scale(0.98); }

.container { max-width: 1100px; margin: 0 auto; padding: 20px; }

.hero {
  background:
    linear-gradient(180deg, rgba(255,212,0,0.08), rgba(255,122,0,0.06)),
    radial-gradient(1000px 150px at 10% -10%, rgba(255,122,0,0.25), transparent),
    radial-gradient(800px 120px at 90% -20%, rgba(255,212,0,0.25), transparent);
  border: 2px dashed rgba(255, 212, 0, 0.35);
  padding: 22px; border-radius: 10px; color: #fff; text-align: center; margin-bottom: 20px;
}
.hero h1 { margin: 0 0 6px; font-size: clamp(22px, 3.6vw, 34px); }
.hero p { margin: 0; color: #d7dde3; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 12px; }
.btn {
  appearance: none; border: 1px solid #303841; color: #eaf1f7; background: #212830;
  padding: 10px 14px; border-radius: 8px; cursor: pointer; font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translateY(-1px); background: #26313a; border-color: #3a4652; }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, var(--amber), var(--orange)); color: #111; border-color: #d96d00; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: #3a1f1f; border-color: #7a3030; color: #ffdede; }

.display { margin: 18px 0; }
.display h2 { margin: 0 0 6px; font-size: 18px; color: #f0f3f6; }
.output {
  min-height: 44px; margin: 0; padding: 12px 14px; border-radius: 8px;
  background: #171c21; border: 1px solid #2a3139; color: #f5f7fa;
}

.yard {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 42vh; border-radius: 12px; border: 2px solid #2a3139;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.05)),
    radial-gradient(1200px 160px at 50% -10%, rgba(255, 180, 0, 0.08), transparent),
    repeating-linear-gradient(90deg, #172028 0 2px, #1a232b 2px 4px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25);
}
.yard:focus { outline: 2px dashed var(--yellow); outline-offset: 2px; }

.sticker {
  position: absolute; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  font-size: 28px; transform-origin: center center;
  opacity: 0; animation: pop-in 160ms ease forwards;
}
@keyframes pop-in { from { transform: scale(0.8) rotate(-3deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes fade-away { to { transform: scale(0.9) translateY(6px); opacity: 0; } }

.meter { margin: 18px 0 6px; }
.meter-label { color: #cfd7df; margin-bottom: 8px; font-weight: 600; }
.meter-bar {
  height: 14px; width: 100%; border-radius: 99px; overflow: hidden; border: 1px solid #2a3139; background: #151a1f;
}
.meter-fill {
  height: 100%; width: 0; background:
    repeating-linear-gradient(45deg, var(--yellow) 0 10px, var(--orange) 10px 20px);
  box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
  transition: width 220ms cubic-bezier(.22,1,.36,1);
}

/* Safety Cone Mode: add a pulsing caution border */
body.cone-mode .container {
  position: relative;
}
body.cone-mode .container::after {
  content: ""; position: absolute; inset: -8px; border-radius: 14px; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 11px, #111 11px 22px);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  padding: 8px; border: 0 solid transparent; animation: cone-pulse 1.2s ease-in-out infinite;
}
@keyframes cone-pulse {
  0%, 100% { opacity: 0.55; filter: saturate(1); }
  50% { opacity: 0.9; filter: saturate(1.1); }
}

/* Small screens */
@media (max-width: 640px) {
  .controls { gap: 8px; }
  .btn { padding: 9px 12px; }
  .sticker { font-size: 24px; }
}
/* Foreman character + speech bubble */
.foreman{ position: fixed; right: 14px; bottom: 14px; z-index: 1000; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
.foreman-svg{ width: 200px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35)); }
.foreman-bubble{ max-width: 280px; background: #0f1419; color: #eaf1f7; border: 1px solid #2a3139; border-radius: 12px; padding: 10px 12px; position: absolute; right: calc(100% + 8px); bottom: 12px; transform-origin: bottom right; box-shadow: 0 10px 24px rgba(0,0,0,0.45); opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 160ms ease, transform 160ms ease; pointer-events: auto; }
.foreman-bubble::after{ content:""; position: absolute; right: -6px; bottom: 16px; width: 10px; height: 10px; background: #0f1419; border: 1px solid #2a3139; border-left: none; border-bottom: none; transform: rotate(45deg); }
.foreman-bubble.show{ opacity: 1; transform: translateY(0) scale(1); }

.foreman-ribbon {
  position: absolute;
  left: 50%;
  top: 150px;
  transform: translateX(-50%) rotate(-16deg);
  background: linear-gradient(180deg, #ffd36b, #ff9a3d);
  color: #111;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border: 1px solid #7a4e00;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  pointer-events: none;
  user-select: none;
}

/* Safety Rep styles */
.safety-rep{ position: fixed; top: 50%; left: -70px; z-index: 950; pointer-events: none; transition: left 180ms ease, right 180ms ease, transform 180ms ease; }
.safety-rep.left{ left: -70px; right: auto; transform: translateY(-50%) translateX(0); }
.safety-rep.left.show{ left: 0; pointer-events: auto; }
.safety-rep.right{ right: -70px; left: auto; transform: translateY(-50%) scaleX(-1); }
.safety-rep.right.show{ right: 0; pointer-events: auto; }
.safety-rep-svg{ width: 64px; height: auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35)); cursor: pointer; transition: filter 0.3s ease; }
.safety-rep.show .safety-rep-svg:hover{ filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35)) drop-shadow(0 0 12px rgba(255, 176, 0, 0.8)); }

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and smaller screens */
@media screen and (max-width: 768px) {
  /* Header styles handled by header.css */
  
  /* Volume valve on smaller screens */
  .vol-valve {
    width: 48px;
    height: 60px;
  }
  
  .valve-knob {
    width: 40px;
    height: 40px;
  }
  
  /* Foreman adjustments for tablets */
  .foreman {
    right: 10px;
    bottom: 10px;
  }
  
  .foreman-svg {
    width: 150px;
  }
  
  .foreman-bubble {
    max-width: 220px;
    font-size: 14px;
    padding: 8px 10px;
  }
  
  /* Safety Rep adjustments */
  .safety-rep-svg {
    width: 54px;
  }
  
  /* Container and sections */
  .container {
    padding: 16px;
  }
  
  .hero {
    padding: 18px;
  }
  
  .hero h1 {
    font-size: 24px;
  }
  
  /* Controls section */
  .controls {
    gap: 8px;
  }
  
  .btn {
    font-size: 14px;
    padding: 10px 14px;
  }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
  /* Header styles handled by header.css */
  
  /* Hide volume valve on very small screens */
  .vol-valve {
    display: none;
  }
  
  /* Foreman character mobile sizing */
  .foreman {
    right: 5px;
    bottom: 5px;
    gap: 4px;
  }
  
  .foreman-svg {
    width: 100px;
  }
  
  .foreman-bubble {
    max-width: 180px;
    font-size: 12px;
    padding: 6px 8px;
    bottom: 8px;
  }
  
  .foreman-bubble::after {
    right: -5px;
    bottom: 12px;
    width: 8px;
    height: 8px;
  }
  
  /* Safety Rep mobile sizing */
  .safety-rep {
    top: 40%;
  }
  
  .safety-rep-svg {
    width: 44px;
  }
  
  .safety-rep.left {
    left: -50px;
  }
  
  .safety-rep.right {
    right: -50px;
  }
  
  /* Container mobile */
  .container {
    padding: 12px;
  }
  
  /* Hero section mobile */
  .hero {
    padding: 14px;
    margin-bottom: 14px;
  }
  
  .hero h1 {
    font-size: 20px;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  /* Controls mobile - stack vertically */
  .controls {
    flex-direction: column;
    gap: 6px;
  }
  
  .controls .btn {
    width: 100%;
    font-size: 14px;
    padding: 12px;
  }
  
  /* Display section */
  .display h2 {
    font-size: 18px;
  }
  
  .output {
    font-size: 14px;
    padding: 10px;
  }
  
  /* Yard section */
  .yard {
    min-height: 120px;
  }
  
  /* Stickers mobile */
  .sticker {
    font-size: 20px !important;
  }
  
  /* Modal adjustments */
  .modal {
    width: min(100%, 96vw);
    padding: 16px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  /* AI float button */
  .ai-float {
    width: 40px;
    height: 40px;
    left: 12px;
    top: 12px;
  }
  
  .ai-float::after {
    font-size: 14px;
  }
}

/* Very small mobile devices */
@media screen and (max-width: 360px) {
  /* Even smaller foreman for tiny screens */
  .foreman-svg {
    width: 80px;
  }
  
  .foreman-bubble {
    max-width: 150px;
    font-size: 11px;
    padding: 5px 6px;
  }
  
  /* Smaller safety rep */
  .safety-rep-svg {
    width: 36px;
  }
  
  /* Header styles handled by header.css */
  
  .hero h1 {
    font-size: 18px;
  }
  
  .controls .btn {
    font-size: 13px;
    padding: 10px;
  }
}

/* Landscape orientation adjustments for mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  /* Header styles handled by header.css */
  
  .hero {
    padding: 12px;
    margin-bottom: 10px;
  }
  
  .hero h1 {
    font-size: 20px;
  }
  
  /* Position foreman lower in landscape */
  .foreman {
    bottom: 5px;
  }
  
  .foreman-svg {
    width: 80px;
  }
  
  /* Adjust safety rep position */
  .safety-rep {
    top: 35%;
  }
  
  .safety-rep-svg {
    width: 40px;
  }
  
  /* Smaller buttons in landscape */
  .controls {
    margin: 10px 0;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* High DPI screens (Retina) adjustments */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
  /* Sharper shadows for high DPI */
  .foreman-svg,
  .safety-rep-svg {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  }
}
