@font-face {
  font-family: Montserrat;
  src: url(https://fonts.gstatic.com/s/montserrat/v26/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2);
}

* {
  box-sizing: border-box;
}

/* ============================================================
   Dynamic Gradient Background
   ============================================================ */
body {
  width: 1920px;
  height: 1080px;
  margin: 0;
  overflow: hidden;
  font-family: Montserrat, sans-serif;
  color: white;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   Floating Particles Background
   ============================================================ */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

.particle:nth-child(1) { left: 10%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; width: 8px; height: 8px; animation-duration: 25s; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; width: 5px; height: 5px; animation-duration: 18s; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; width: 7px; height: 7px; animation-duration: 22s; animation-delay: 1s; }
.particle:nth-child(5) { left: 55%; width: 4px; height: 4px; animation-duration: 28s; animation-delay: 3s; }
.particle:nth-child(6) { left: 65%; width: 9px; height: 9px; animation-duration: 19s; animation-delay: 5s; }
.particle:nth-child(7) { left: 75%; width: 5px; height: 5px; animation-duration: 24s; animation-delay: 0s; }
.particle:nth-child(8) { left: 85%; width: 6px; height: 6px; animation-duration: 21s; animation-delay: 2s; }
.particle:nth-child(9) { left: 15%; width: 3px; height: 3px; animation-duration: 26s; animation-delay: 6s; }
.particle:nth-child(10) { left: 50%; width: 7px; height: 7px; animation-duration: 17s; animation-delay: 1s; }
.particle:nth-child(11) { left: 90%; width: 5px; height: 5px; animation-duration: 23s; animation-delay: 4s; }
.particle:nth-child(12) { left: 5%; width: 8px; height: 8px; animation-duration: 27s; animation-delay: 3s; }

@keyframes floatParticle {
  0% {
    transform: translateY(1080px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================================
   Main Launcher Container
   ============================================================ */
#launcher {
  position: relative;
  z-index: 1;
  width: 1920px;
  height: 1080px;
  display: flex;
  flex-direction: column;
  padding: 30px 60px;
}

/* ============================================================
   Status Bar (Glassmorphism)
   ============================================================ */
#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  font-size: 20px;
  color: #ddd;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-bottom: 20px;
}

#status-left, #status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.separator {
  color: rgba(255, 255, 255, 0.3);
}

#weather-info {
  font-size: 18px;
  color: #aed581;
}

#connection-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

#connection-status.connected {
  background: linear-gradient(135deg, rgba(27, 94, 32, 0.8), rgba(56, 142, 60, 0.8));
  color: #a5d6a7;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

#connection-status.disconnected {
  background: linear-gradient(135deg, rgba(74, 21, 21, 0.8), rgba(136, 14, 14, 0.8));
  color: #ef9a9a;
  box-shadow: 0 0 12px rgba(244, 67, 54, 0.3);
}

/* ============================================================
   Carousel / Ad Banner
   ============================================================ */
#carousel-container {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 60px;
  position: relative;
}

.slide-gradient-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.slide-gradient-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.slide-gradient-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slide-gradient-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.slide-text h2 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slide-text p {
  font-size: 20px;
  margin: 0;
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.slide-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#carousel-indicators {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  width: 30px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
}

#carousel-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

#carousel-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.7);
  transition: width 0.1s linear;
}

/* ============================================================
   Section Header
   ============================================================ */
#section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-icon {
  font-size: 32px;
}

.section-title h1 {
  font-size: 36px;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(90deg, #fff, #aed581);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Number Input Display */
#number-display {
  min-width: 120px;
  height: 48px;
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 12px;
  font-family: monospace;
  font-size: 32px;
  font-weight: bold;
  color: #4fc3f7;
  display: flex;
  align-items: center;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

/* ============================================================
   App Grid
   ============================================================ */
#app-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 30px;
  padding: 10px;
  flex: 1;
  align-content: center;
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 24px 16px 20px;
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-item:hover,
.app-item:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.app-item:focus {
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.6), 0 12px 40px rgba(0, 0, 0, 0.3);
}

.app-item.launching {
  opacity: 0.5;
  transform: scale(0.92);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.app-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-icon {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  color: white;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.app-item:hover .app-icon,
.app-item:focus .app-icon {
  transform: scale(1.05);
}

.app-glow {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 24px;
  filter: blur(20px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.app-item:hover .app-glow,
.app-item:focus .app-glow {
  opacity: 0.5;
}

.netflix-glow { background: #e50914; }
.youtube-glow { background: #ff0000; }
.disney-glow { background: #113ccf; }
.prime-glow { background: #00a8e1; }
.spotify-glow { background: #1db954; }
.plex-glow { background: #e5a00d; }

.youtube-icon {
  background: linear-gradient(135deg, #ff0000, #cc0000);
}

.netflix-icon {
  background: linear-gradient(135deg, #e50914, #b20710);
}

.disney-icon {
  background: linear-gradient(135deg, #113ccf, #0e2a8a);
}

.prime-icon {
  background: linear-gradient(135deg, #00a8e1, #007eb5);
}

.spotify-icon {
  background: linear-gradient(135deg, #1db954, #158f3f);
}

.plex-icon {
  background: linear-gradient(135deg, #e5a00d, #cc8a00);
}

.app-name {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.app-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   Floating Log Panel (Glassmorphism)
   ============================================================ */
#floating-log {
  position: fixed;
  bottom: 30px;
  right: 60px;
  width: 600px;
  z-index: 100;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10, 10, 30, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#floating-log.collapsed #message-log {
  height: 0;
  padding: 0 20px;
  opacity: 0;
}

#floating-log.collapsed {
  width: 280px;
}

#log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

#log-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

#log-controls {
  display: flex;
  gap: 8px;
}

#log-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

#log-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

#message-log {
  height: 180px;
  padding: 16px 20px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  transition: all 0.4s ease;
  opacity: 1;
}

#message-log::-webkit-scrollbar {
  width: 6px;
}

#message-log::-webkit-scrollbar-track {
  background: transparent;
}

#message-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#log-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  padding: 4px 10px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  line-height: 1.5;
}

.log-entry.sent {
  color: #81c784;
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.05);
}

.log-entry.received {
  color: #64b5f6;
  border-left-color: #2196f3;
  background: rgba(33, 150, 243, 0.05);
}

.log-entry.error {
  color: #ef5350;
  border-left-color: #f44336;
  background: rgba(244, 67, 54, 0.05);
}

.log-entry.info {
  color: rgba(255, 255, 255, 0.6);
  border-left-color: rgba(255, 255, 255, 0.2);
}
