/* ---------- BASIC LAYOUT ---------- */
:root{
  --accent: #00ff66;
  --muted-bg: rgba(0,0,0,0.6);
  --panel-bg: rgba(10,10,10,0.65);
}

html,body{
  height:100%;
  margin:0;
  background:#000; /* keeps edges black behind matrix */
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #e6f7e6;
}

/* Matrix canvas sits behind everything */
#matrixCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    display: block;
}

/* camera container centered */
#cameraContainer {
    position: relative;
    width: 640px;
    margin: 28px auto;
    text-align: center;
    z-index: 10;
    max-width: calc(100% - 32px);
}

/* Camera video preview */
#cameraFeed {
    width: 100%;
    height: auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
      0 12px 30px rgba(0,0,0,0.6),
      0 0 50px rgba(0,255,102,0.06) inset;
    border: 2px solid rgba(0,255,102,0.06);
    display: block;
    transform-origin: center center;
    transition: transform 200ms ease, box-shadow 300ms ease;
}

/* subtle scale on hover */
#cameraFeed:hover{
    transform: scale(1.02);
    box-shadow:
      0 18px 50px rgba(0,0,0,0.7),
      0 0 70px rgba(0,255,102,0.11) inset;
}

/* overlay timestamp (top-right) */
#timestampOverlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--muted-bg);
    color: #dfffe6;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    backdrop-filter: blur(4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

/* center countdown (big circular number) */
#countdownDisplay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    color: var(--accent);
    font-size: 44px;
    border-radius: 50%;
    width: 110px;
    height: 110px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,255,102,0.12);
    box-shadow: 0 6px 30px rgba(0,0,0,0.6), 0 0 40px rgba(0,255,102,0.05);
    z-index: 20;
}

/* controls */
#controls {
    margin: 10px 0 6px;
}
button {
    margin: 6px 6px;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: #e8ffee;
    cursor: pointer;
    min-width: 92px;
    transition: transform 120ms ease, box-shadow 200ms ease, background 180ms;
    box-shadow: 0 6px 14px rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
}
button:hover{
    transform: translateY(-3px);
    background: linear-gradient(180deg, rgba(0,255,102,0.06), rgba(255,255,255,0.02));
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(0,255,102,0.08);
}

/* filters row */
#filters{ margin: 8px 0; }
.filterBtn{
    padding: 8px 12px;
    border-radius: 6px;
}

/* settings panel */
#settingsPanel {
    margin: 8px auto;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    width: calc(100% - 40px);
    text-align: left;
}

/* AI Results panel - hidden by default, animated in when .show added */
#aiResults {
    width: calc(100% - 20px);
    margin: 12px auto 0;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(10,10,10,0.3));
    border: 1px solid rgba(0,255,102,0.06);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(20px) scale(0.99);
    transition: opacity 420ms cubic-bezier(.2,.9,.3,1), transform 420ms cubic-bezier(.2,.9,.3,1);
    z-index: 30;
}

/* shown state */
#aiResults.show {
    display: block; /* previously set to block by JS, keep as block for animation */
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* list items appear staggered via inline animation-delay set in JS */
#aiResults ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}
#aiResults li {
    margin: 6px 0;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.25);
    color: #e9ffe9;
    font-size: 14px;
    display: inline-block;
    min-width: 120px;
    transform: translateX(-12px);
    opacity: 0;
    animation: aiFadeIn 420ms forwards;
}

/* AI item animation keyframes (fade + slide from left) */
@keyframes aiFadeIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* accessibility & responsive */
@media (max-width: 768px) {
    #cameraContainer { width: 100%; margin: 14px auto; }
    #countdownDisplay { width: 86px; height: 86px; font-size: 34px; }
    button { min-width: 72px; padding: 8px 10px; }
}

/* minor decorative glow to match matrix theme */
#cameraContainer::before{
  content: "";
  pointer-events: none;
  position: absolute;
  inset: -18px;
  border-radius: 18px;
  box-shadow: 0 0 80px rgba(0,255,102,0.035);
  z-index: -1;
}
