/* ==========================================================================
   Android Safety Team Kiosk - Style Sheet
   ========================================================================== */

/* Design Tokens & Custom Properties */
:root {
  --bg-primary: #07080d;
  --bg-secondary: #0d0f17;
  --card-bg: rgba(18, 22, 35, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(61, 220, 132, 0.4);
  
  /* Brand & Theme Colors */
  --android-green: #3ddc84;
  --safety-orange: #ff9800;
  --safety-orange-glow: rgba(255, 152, 0, 0.15);
  --emergency-red: #ff3333;
  --accent-blue: #00b0ff;
  
  /* Text Colors */
  --text-primary: #f5f6fa;
  --text-secondary: #9aa0a6;
  --text-muted: #606468;
  
  /* Layout */
  --header-height: 80px;
  --footer-height: 70px;
  --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .logo-title, .stat-number, .main-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

/* Background Ambient Glows */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: pulse-glow 12s infinite alternate ease-in-out;
}

.glow-1 {
  background: radial-gradient(circle, var(--android-green) 0%, transparent 70%);
  top: -200px;
  right: -100px;
}

.glow-2 {
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
  bottom: -200px;
  left: -100px;
  animation-delay: -6s;
}

@keyframes pulse-glow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
  100% { transform: scale(1.2) translate(50px, 30px); opacity: 0.2; }
}

/* Glassmorphism Card Utility */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.hover-glow:hover {
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 0 20px 0 rgba(61, 220, 132, 0.1);
  border-color: var(--card-hover-border);
}

/* Top Navigation Bar */
.top-bar {
  flex-shrink: 0;
  height: var(--header-height);
  width: 100%;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 8, 13, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10;
  position: relative;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.android-logo {
  width: 32px;
  height: 32px;
  color: var(--android-green);
}

.logo-title {
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  white-space: nowrap;
}

.active-slide-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--android-green);
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  justify-self: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--android-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--android-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

.status-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Auto-Rotation Progress Bar */
.progress-bar-container {
  flex-shrink: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  z-index: 10;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--android-green), var(--accent-blue));
  transition: width 0.1s linear;
}

/* Kiosk Slides Container */
.kiosk-container {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  width: 100%;
  z-index: 1;
  overflow: hidden;
}

/* Base Slide Styles */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(0.98) translateY(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.slide-content {
  width: 100%;
  max-width: 1720px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}

/* ==========================================================================
   SLIDE 1: Mission & Stats Layout
   ========================================================================== */
.mission-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 60px;
}

.hero-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tagline {
  color: var(--android-green);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

.main-heading {
  font-size: 54px;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -1.5px;
}

.sub-heading {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 300;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 4px;
  align-items: center;
}

.stat-icon-wrapper {
  grid-row: span 2;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-icon-wrapper svg {
  width: 40px;
  height: 40px;
}

.earthquake-accent {
  color: var(--safety-orange);
  background: rgba(255, 152, 0, 0.05);
  border-color: rgba(255, 152, 0, 0.15);
}

.crash-accent {
  color: var(--android-green);
  background: rgba(61, 220, 132, 0.05);
  border-color: rgba(61, 220, 132, 0.15);
}

.global-accent {
  color: var(--accent-blue);
  background: rgba(0, 176, 255, 0.05);
  border-color: rgba(0, 176, 255, 0.15);
}

.stat-number {
  font-size: 38px;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-desc {
  grid-column: 2;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   SLIDE 2: Article Spotlight Layout
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.article-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: fit-content;
  border-left: 4px solid var(--safety-orange);
}

.press-badge {
  color: var(--safety-orange);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1.5px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

.article-headline {
  font-size: 36px;
  line-height: 1.25;
  letter-spacing: -1px;
}

.article-snippet {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.article-stats {
  display: flex;
  gap: 30px;
  margin: 10px 0;
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

.quote-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 15px 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.quote-text {
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.quote-author {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Article Screenshot Mockup browser frame */
.article-media-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.browser-frame {
  width: 100%;
  max-width: 750px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  background: #0f1015;
}

.browser-header {
  height: 40px;
  background: #161822;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
}

.browser-buttons {
  display: flex;
  gap: 6px;
}

.browser-buttons span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
}

.browser-address {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.article-image-wrapper {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.kiosk-article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0.95;
  transition: transform 12s linear;
}

/* Auto-panning visual effect on active slide */
.slide.active .kiosk-article-image {
  transform: scale(1.03) translateY(-15%);
}

/* ==========================================================================
   SLIDE 3: Kind Tweets Wall Layout
   ========================================================================== */
.tweets-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start !important;
  gap: 24px !important;
}

.tweets-header {
  text-align: center;
  margin-bottom: 10px;
}

.section-title {
  font-size: 32px;
  margin-top: 4px;
  letter-spacing: -0.8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 700px;
  margin: 6px auto 0 auto;
}

.tweets-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Fading mask on the top and bottom of tweets column */
.tweets-grid-container::before,
.tweets-grid-container::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 30px;
  z-index: 5;
  pointer-events: none;
}

.tweets-grid-container::before {
  top: 0;
  background: linear-gradient(180deg, var(--bg-primary) 0%, transparent 100%);
}

.tweets-grid-container::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--bg-primary) 0%, transparent 100%);
}

.tweets-marquee-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Simple and robust infinite scroll animation */
  animation: marquee-scroll 50s linear infinite;
}

.tweets-marquee-col:nth-child(2) {
  animation-duration: 65s;
  animation-direction: reverse;
}

.tweets-marquee-col:nth-child(3) {
  animation-duration: 55s;
}

/* Pause scroll when hover */
.tweets-marquee-col:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* Styled Tweet Cards */
.tweet-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(20, 24, 38, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  break-inside: avoid;
}

.tweet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tweet-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tweet-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #252836;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--android-green);
  text-transform: uppercase;
}

.tweet-user-info {
  display: flex;
  flex-direction: column;
}

.tweet-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tweet-user-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.twitter-logo-icon {
  width: 18px;
  height: 18px;
  color: #1da1f2;
}

.tweet-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-line;
}

.tweet-body strong {
  color: var(--android-green);
}

.tweet-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.tweet-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tweet-stat svg {
  width: 14px;
  height: 14px;
}

/* Highlights for featured/important tweets */
.tweet-card.featured {
  border-color: rgba(61, 220, 132, 0.2);
  background: rgba(61, 220, 132, 0.03);
}

.tweet-card.featured .tweet-avatar {
  background: var(--android-green);
  color: #07080d;
}

/* ==========================================================================
   SLIDE 4: Videos Showcase Layout
   ========================================================================== */
.video-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
}

.video-player-container {
  width: 100%;
  height: 520px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback Blueprint Style */
.video-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #0d0f17 0%, #07080c 100%);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.fallback-icon {
  width: 120px;
  height: 120px;
}

.pulsing-radar {
  width: 100%;
  height: 100%;
  animation: radar-rotation 20s linear infinite;
}

@keyframes radar-rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.video-fallback h3 {
  font-size: 24px;
  color: var(--text-primary);
  margin-top: 10px;
}

.video-fallback p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 450px;
  line-height: 1.5;
}

.fallback-helper {
  font-family: monospace;
  font-size: 12px;
  color: var(--android-green);
  background: rgba(61, 220, 132, 0.08);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(61, 220, 132, 0.15);
}

.video-info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 4px solid var(--android-green);
}

.video-badge {
  color: var(--android-green);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1.5px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

.video-headline {
  font-size: 32px;
  line-height: 1.25;
}

.video-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.video-controls-info {
  display: flex;
  gap: 12px;
}

.control-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ==========================================================================
   Interactive Bottom Controls Bar
   ========================================================================== */
.controls-bar {
  flex-shrink: 0;
  height: var(--footer-height);
  width: 100%;
  background: rgba(7, 8, 13, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 40px;
  position: relative;
  z-index: 100;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Auto-hide states */
.controls-bar.idle {
  opacity: 0.15;
}

.controls-bar.idle:hover {
  opacity: 1;
}

.control-section {
  display: flex;
  align-items: center;
}

.navigation-controls {
  gap: 14px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ctrl-btn svg {
  width: 18px;
  height: 18px;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.main-ctrl {
  width: 46px;
  height: 46px;
  background: var(--android-green);
  color: #07080d;
  border: none;
}

.main-ctrl:hover {
  background: #34c776;
  box-shadow: 0 0 12px rgba(61, 220, 132, 0.4);
}

/* Slide Dots Indicators */
.slide-indicators {
  gap: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.dot.active {
  background: var(--android-green);
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--android-green);
}

/* Time Configuration */
.time-config {
  justify-content: flex-end;
  gap: 10px;
}

.speed-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.glass-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.glass-select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

@media (max-width: 1400px) {
  .logo-title { font-size: 16px; }
  .active-slide-title { font-size: 16px; }
  .main-heading { font-size: 42px; }
  .sub-heading { font-size: 17px; }
  .stat-number { font-size: 32px; }
  .article-headline { font-size: 28px; }
  .article-snippet { font-size: 15px; }
  .browser-frame { max-width: 580px; }
  .article-image-wrapper { height: 420px; }
  .video-player-container { height: 420px; }
  .video-headline { font-size: 26px; }
  .video-description { font-size: 14px; }
}

@media (max-width: 960px) {
  .top-bar {
    grid-template-columns: 1.5fr 1fr;
    padding: 0 20px;
  }
  .header-spacer {
    display: none;
  }
  .logo-title { font-size: 14px; }
  .active-slide-title { font-size: 13px; justify-self: end; }
  .mission-layout, .article-layout, .video-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .browser-frame { max-width: 100%; }
  .tweets-grid-container {
    grid-template-columns: 1fr 1fr;
  }
  #tweets-marquee-col-3 {
    display: none;
  }
}
