/* ==========================================================================
   Bored.fufuk.com - Ultra Modern Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&family=Outfit:wght@400;600;800;900&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #070913;
  --bg-card: rgba(18, 24, 43, 0.75);
  --bg-card-hover: rgba(28, 36, 61, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.4);

  /* Brand Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --grad-accent: linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #f97316 100%);
  --grad-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-dark: linear-gradient(180deg, #0b0f19 0%, #070913 100%);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);

  /* Utility */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.15);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.35);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  overflow-x: hidden;
  position: relative;
}

/* Dynamic Animated Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: floatBlob 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: #ec4899;
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.blob-3 {
  width: 380px;
  height: 380px;
  background: #10b981;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 70px) scale(0.9); }
}

/* Layout Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 1rem;
  z-index: 100;
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 0.75rem 1.5rem;
  background: rgba(13, 18, 36, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--grad-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.pwa-install-btn {
  background: var(--grad-accent);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
  transition: var(--transition-smooth);
}

.pwa-install-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.6);
}

/* Sections & Views */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section Banner */
.hero-banner {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Cards & Glass Containers */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-main);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Section 1: Boredom Buster */
.bored-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .bored-grid {
    grid-template-columns: 1fr;
  }
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.pill-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #a5b4fc;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Slot Machine Challenge Display */
.slot-machine-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 60%), var(--bg-card);
}

.slot-machine-card.spinning {
  animation: slotPulse 0.2s infinite alternate;
}

@keyframes slotPulse {
  0% { transform: scale(0.995); border-color: #6366f1; }
  100% { transform: scale(1.005); border-color: #ec4899; }
}

.challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.challenge-tag {
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.challenge-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.challenge-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.challenge-body {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.challenge-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.challenge-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.challenge-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Primary Button Styles */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.btn-accent {
  background: var(--grad-accent);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

.btn-accent:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Section 2: Meme Studio */
.meme-studio-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .meme-studio-grid {
    grid-template-columns: 1fr;
  }
}

.meme-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  border: 1px stroke rgba(255, 255, 255, 0.1);
}

#meme-canvas {
  max-width: 100%;
  height: auto;
  max-height: 520px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.meme-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Template Picker Grid */
.template-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.templates-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.template-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.template-thumb:hover {
  transform: scale(1.08);
  border-color: #a5b4fc;
}

.template-thumb.active {
  border-color: #ec4899;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.text-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.text-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.color-picker-input {
  -webkit-appearance: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: 2px solid var(--border-glass);
  border-radius: 50%;
}

.range-slider {
  flex: 1;
  accent-color: #6366f1;
}

/* Section 3: Quotes & Jokes */
.quote-container {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15), transparent 70%), var(--bg-card);
}

.quote-mark {
  font-size: 5rem;
  line-height: 0;
  color: rgba(99, 102, 241, 0.25);
  font-family: Georgia, serif;
  margin-bottom: 1.5rem;
}

.quote-text {
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.quote-author {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.category-tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(18, 24, 43, 0.95);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: slideInToast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-main);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.share-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.share-item-icon {
  font-size: 1.6rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: #6366f1;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    justify-content: center;
    overflow-x: auto;
  }
  .tab-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Language Select Dropdown */
.lang-select-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.lang-select-box:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-select-box option {
  background: #0f172a;
  color: #ffffff;
  padding: 0.5rem;
}

