/* ============================================================
   StupidLab.com — Retro Quirky Stylesheet
   Aesthetic: 1990s GeoCities meets Saturday Morning Cartoons
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323:wght@400&family=Special+Elite&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --yellow:     #FFE600;
  --red:        #FF2D2D;
  --blue:       #0038FF;
  --green:      #00C800;
  --black:      #111111;
  --white:      #FFFEF0;
  --cream:      #FFF8DC;
  --purple:     #8B00FF;
  --orange:     #FF6600;
  --bg:         #FFFEF0;

  --border:     3px solid var(--black);
  --shadow:     5px 5px 0px var(--black);
  --shadow-lg:  8px 8px 0px var(--black);

  --font-pixel: 'Press Start 2P', monospace;
  --font-vt:    'VT323', monospace;
  --font-type:  'Special Elite', serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(0,56,255,0.07) 39px,
      rgba(0,56,255,0.07) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(0,56,255,0.07) 39px,
      rgba(0,56,255,0.07) 40px
    );
  font-family: var(--font-type);
  font-size: 18px;
  color: var(--black);
  min-height: 100vh;
}

a { color: var(--blue); font-weight: bold; }
a:hover { color: var(--red); text-decoration: underline wavy; }

/* ============================================================
   MARQUEE HEADER STRIP
   ============================================================ */
.marquee-strip {
  background: var(--yellow);
  border-top: var(--border);
  border-bottom: var(--border);
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-strip .inner {
  display: inline-block;
  animation: marquee 20s linear infinite;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 2px;
}
@keyframes marquee {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--black);
  padding: 20px;
  text-align: center;
  border-bottom: 5px solid var(--yellow);
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★';
  position: absolute;
  top: 0; left: 0; right: 0;
  font-size: 10px;
  color: var(--yellow);
  opacity: 0.4;
  letter-spacing: 10px;
  padding: 4px;
}

.site-logo {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 4vw, 28px);
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--orange);
  display: inline-block;
  animation: wobble 3s ease-in-out infinite;
  text-decoration: none;
}
.site-logo:hover { color: var(--yellow); text-decoration: none; }

@keyframes wobble {
  0%, 100% { transform: rotate(-1deg); }
  50%       { transform: rotate(1deg); }
}

.site-tagline {
  font-family: var(--font-vt);
  font-size: 22px;
  color: var(--green);
  margin-top: 8px;
  letter-spacing: 2px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  background: var(--blue);
  border-bottom: var(--border);
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0;
}
.site-nav a {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--white);
  text-decoration: none;
  padding: 12px 20px;
  display: inline-block;
  border-right: 2px solid rgba(255,255,255,0.2);
  transition: background 0.1s;
}
.site-nav a:hover, .site-nav a.active {
  background: var(--yellow);
  color: var(--black);
  text-decoration: none;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ============================================================
   JOKE CARD
   ============================================================ */
.joke-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-lg);
  margin-bottom: 30px;
  position: relative;
}

.joke-date-banner {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 15px;
  border-bottom: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.joke-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 600px) {
  .joke-content { grid-template-columns: 1fr; }
}

.joke-cartoon {
  border-right: var(--border);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
.joke-cartoon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.joke-cartoon .no-image {
  font-family: var(--font-vt);
  font-size: 80px;
  opacity: 0.3;
}

.joke-text-area {
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
}

.joke-text {
  font-family: var(--font-vt);
  font-size: 28px;
  line-height: 1.4;
  color: var(--black);
}

.joke-number {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #999;
}

/* ============================================================
   GROAN-O-METER
   ============================================================ */
.groan-o-meter {
  background: var(--cream);
  border: var(--border);
  padding: 20px;
  position: relative;
}

.groan-o-meter-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  text-align: center;
  margin-bottom: 15px;
  color: var(--black);
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-vt);
  font-size: 22px;
  margin-bottom: 8px;
  padding: 0 5px;
}

.meter-track {
  width: 100%;
  height: 30px;
  background: linear-gradient(to right, #FFE600, #FF9900, #FF2D2D);
  border: var(--border);
  border-radius: 0;
  position: relative;
  overflow: visible;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(to right, #00C800, #FFE600);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.meter-needle {
  position: absolute;
  top: -8px;
  width: 4px;
  height: 46px;
  background: var(--black);
  transform: translateX(-50%);
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}
.meter-needle::after {
  content: '▼';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--black);
}

.meter-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-vt);
  font-size: 18px;
}

/* Vote Buttons */
.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.vote-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 12px 8px;
  border: var(--border);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: var(--shadow);
  text-align: center;
  background: var(--white);
}
.vote-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--black);
}
.vote-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--black);
}
.vote-btn.groan-btn {
  background: var(--red);
  color: var(--white);
}
.vote-btn.laugh-btn {
  background: var(--green);
  color: var(--white);
}
.vote-btn:disabled, .vote-btn.voted {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.vote-message {
  font-family: var(--font-vt);
  font-size: 20px;
  text-align: center;
  margin-top: 10px;
  min-height: 24px;
  color: var(--purple);
}

.vote-count {
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: center;
  margin-top: 5px;
  color: #777;
}

/* ============================================================
   RETRO BOXES / PANELS
   ============================================================ */
.retro-box {
  border: var(--border);
  box-shadow: var(--shadow);
  background: var(--white);
  padding: 20px;
  margin-bottom: 20px;
}

.retro-box-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--black);
  color: var(--yellow);
  padding: 8px 12px;
  margin: -20px -20px 15px -20px;
}

/* ============================================================
   WEEK VIEW GRID
   ============================================================ */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.week-joke-card {
  border: var(--border);
  box-shadow: var(--shadow);
  background: var(--white);
  overflow: hidden;
  transition: transform 0.15s;
}
.week-joke-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--black);
}

.week-joke-card .card-day {
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 12px;
  border-bottom: var(--border);
}

.week-joke-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: var(--border);
  display: block;
}

.week-joke-card .card-joke {
  padding: 12px;
  font-family: var(--font-vt);
  font-size: 20px;
  line-height: 1.3;
}

.week-joke-card .mini-meter {
  padding: 8px 12px 12px;
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */
.admin-body {
  background: #1a1a2e;
  color: #e0e0e0;
}

.admin-header {
  background: #16213e;
  padding: 15px 25px;
  border-bottom: 3px solid var(--yellow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--yellow);
}

.admin-nav a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #aaa;
  text-decoration: none;
  margin-left: 20px;
}
.admin-nav a:hover { color: var(--yellow); }

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-box {
  background: #16213e;
  border: 2px solid #333;
  padding: 20px;
  text-align: center;
}
.stat-box .stat-num {
  font-family: var(--font-pixel);
  font-size: 28px;
  color: var(--yellow);
  display: block;
  margin-bottom: 8px;
}
.stat-box .stat-label {
  font-family: var(--font-vt);
  font-size: 18px;
  color: #aaa;
  letter-spacing: 1px;
}

.admin-panel {
  background: #16213e;
  border: 2px solid #333;
  margin-bottom: 25px;
  overflow: hidden;
}
.admin-panel-header {
  background: #0f3460;
  padding: 12px 20px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--yellow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-panel-body {
  padding: 20px;
}

/* Admin buttons */
.btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 10px 16px;
  border: 2px solid;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: all 0.1s;
}
.btn-primary { background: var(--blue); color: white; border-color: #0022cc; }
.btn-success { background: var(--green); color: white; border-color: #009900; }
.btn-danger  { background: var(--red);  color: white; border-color: #cc0000; }
.btn-warning { background: var(--yellow); color: var(--black); border-color: #cc9900; }
.btn-sm { font-size: 7px; padding: 6px 10px; }
.btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* Admin joke cards */
.pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.pending-card {
  background: #0f1729;
  border: 2px solid #333;
  overflow: hidden;
}
.pending-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-bottom: 2px solid #333;
}
.pending-card .placeholder-img {
  width: 100%;
  aspect-ratio: 1;
  background: #1a2a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  border-bottom: 2px solid #333;
}
.pending-card .card-body {
  padding: 12px;
}
.pending-card .joke-preview {
  font-family: var(--font-vt);
  font-size: 18px;
  color: #ddd;
  margin-bottom: 10px;
  line-height: 1.4;
}
.pending-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pending-card input[type="date"] {
  background: #1a2a4a;
  border: 1px solid #555;
  color: #ddd;
  padding: 5px;
  font-family: var(--font-vt);
  font-size: 16px;
  width: 100%;
  margin-bottom: 6px;
}

/* Schedule table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-table th, .schedule-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #333;
  font-family: var(--font-vt);
  font-size: 18px;
}
.schedule-table th {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--yellow);
  background: #0f1729;
}
.schedule-table tr:hover td { background: #1a2a4a; }

/* Flash messages */
.flash {
  padding: 12px 20px;
  margin-bottom: 20px;
  font-family: var(--font-vt);
  font-size: 20px;
  border: 2px solid;
}
.flash-success { background: #1a4a1a; border-color: var(--green); color: #88ff88; }
.flash-error   { background: #4a1a1a; border-color: var(--red);   color: #ff8888; }

/* Status badges */
.badge {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 3px 7px;
  display: inline-block;
}
.badge-pending   { background: #555;          color: #ccc; }
.badge-approved  { background: var(--blue);   color: white; }
.badge-published { background: var(--green);  color: white; }
.badge-failed    { background: var(--red);    color: white; }
.badge-complete  { background: var(--purple); color: white; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
  min-height: 100vh;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #16213e;
  border: 3px solid var(--yellow);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 10px 10px 0 rgba(255,230,0,0.3);
}
.login-box h1 {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--yellow);
  text-align: center;
  margin-bottom: 30px;
}
.login-box input[type="password"] {
  width: 100%;
  background: #0f1729;
  border: 2px solid #555;
  color: #ddd;
  padding: 12px;
  font-family: var(--font-vt);
  font-size: 22px;
  margin-bottom: 15px;
  letter-spacing: 4px;
}
.login-box input:focus {
  outline: none;
  border-color: var(--yellow);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black);
  color: var(--yellow);
  text-align: center;
  padding: 20px;
  border-top: 5px solid var(--yellow);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 2;
}
.site-footer a { color: var(--orange); }

/* ============================================================
   UNDER CONSTRUCTION / EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  font-family: var(--font-vt);
  font-size: 24px;
  color: #aaa;
}
.empty-state .big-icon { font-size: 80px; display: block; margin-bottom: 15px; }

/* ============================================================
   BLINKING ELEMENTS (CLASSIC!)
   ============================================================ */
.blink {
  animation: blink 1s step-start infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.bounce-in {
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounceIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Spinning star loader */
.loading-spinner {
  display: inline-block;
  animation: spin 0.8s linear infinite;
  font-size: 24px;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
