/* ============================================
   Пятница Smart TV - Styles
   ============================================ */

:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-surface: #141420;
  --bg-surface-hover: #1a1a2e;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.4);
  --success: #00cec9;
  --text-primary: #e0e0f0;
  --text-secondary: #6b6b80;
  --text-muted: #4a4a5a;

  /* Spacing */
  --header-height: 80px;
  --footer-height: 100px;
  --tile-gap: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-primary);
  cursor: default;
}

/* Hide cursor after inactivity */
body.cursor-hidden {
  cursor: none;
}

.hidden {
  display: none !important;
}

/* ============================================
   Intro Screen
   ============================================ */

.intro {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro.fade-out {
  opacity: 0;
  visibility: hidden;
}

.intro-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.intro-logo {
  font-size: 120px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.intro-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 64px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 50px;
}

.intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 40px;
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, var(--accent), #8b7cf7);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  box-shadow: 0 4px 30px var(--accent-glow);
}

.intro-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 40px var(--accent-glow);
}

.intro-btn:active {
  transform: scale(0.98);
}

.intro-btn-icon {
  font-size: 24px;
}

.intro-hint {
  margin-top: 30px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================
   Main UI
   ============================================ */

.main-ui {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.main-ui.visible {
  opacity: 1;
}

/* Ambient Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: drift 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #00cec9;
  bottom: -100px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #fd79a8;
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, 30px) scale(1.1); }
  50% { transform: translate(-30px, 60px) scale(0.95); }
  75% { transform: translate(40px, -20px) scale(1.05); }
}

/* ============================================
   Header
   ============================================ */

.header {
  position: relative;
  z-index: 10;
  height: var(--header-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.9), transparent);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  font-size: 36px;
}

.header-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header-weather {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-radius: 30px;
}

.weather-icon {
  font-size: 24px;
}

.weather-temp {
  font-size: 18px;
  font-weight: 600;
}

.header-date {
  font-size: 16px;
  color: var(--text-secondary);
}

.header-time {
  font-family: 'Unbounded', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================
   Tiles Grid
   ============================================ */

.tiles-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 60px;
  position: relative;
  z-index: 10;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tile-gap);
  max-width: 1400px;
  width: 100%;
}

.tile {
  position: relative;
  aspect-ratio: 1.3;
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition-normal),
              border-color var(--transition-normal),
              box-shadow var(--transition-normal),
              background var(--transition-normal);
  overflow: hidden;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
  border-radius: 22px;
  pointer-events: none;
}

.tile:hover {
  transform: scale(1.03);
  background: var(--bg-surface-hover);
  border-color: var(--tile-color, var(--accent));
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
              0 0 30px var(--tile-glow, var(--accent-glow));
}

.tile:active {
  transform: scale(0.98);
}

/* Focused tile (voice/keyboard navigation) - soft glow style */
.tile.focused {
  transform: scale(1.05);
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(124, 110, 240, 0.6),
              0 0 30px rgba(124, 110, 240, 0.3),
              0 15px 50px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.tile.focused::after {
  display: none;
}

.tile-icon {
  font-size: 56px;
  line-height: 1;
}

.tile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.tile-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Tile placeholder state */
.tile.placeholder {
  opacity: 0.6;
}

.tile.placeholder:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}

/* ============================================
   Voice Bar (Footer)
   ============================================ */

.voice-bar {
  position: relative;
  z-index: 10;
  height: var(--footer-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.9), transparent);
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition-fast);
}

.voice-status.listening .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.voice-status.wake .status-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

.voice-status.error .status-dot {
  background: #ff6b6b;
  box-shadow: 0 0 10px #ff6b6b;
}

.voice-status.processing .status-dot {
  background: #ffd93d;
  box-shadow: 0 0 10px #ffd93d;
  animation: blink 0.3s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.voice-status.disabled .status-dot {
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

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

/* Mic Wrapper with Text Input */
.mic-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.text-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--text-muted);
  border-radius: 30px;
  padding: 8px 8px 8px 20px;
  transition: border-color var(--transition-normal);
}

.text-input-wrapper:focus-within {
  border-color: var(--accent);
}

.text-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  width: 200px;
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-submit {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.text-submit:hover {
  background: #8b7cf7;
}

.text-submit:active {
  transform: scale(0.95);
}

/* Microphone Button */
.mic-btn {
  position: relative;
  width: 70px;
  height: 70px;
  background: var(--bg-surface);
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-normal),
              background var(--transition-normal),
              transform var(--transition-normal);
}

.mic-btn:hover {
  border-color: var(--accent);
  background: var(--bg-surface-hover);
}

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

.mic-btn.active {
  border-color: var(--success);
  background: rgba(0, 206, 201, 0.1);
}

.mic-btn.recording {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.2);
  animation: pulse-recording 0.5s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.mic-btn.wake {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
}

.mic-btn.disabled {
  border-color: var(--text-muted);
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-icon {
  font-size: 28px;
  position: relative;
  z-index: 2;
}

/* Mic Rings Animation */
.mic-rings {
  position: absolute;
  inset: -10px;
  pointer-events: none;
}

.mic-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.mic-btn.wake .mic-ring {
  animation: ring-pulse 1.5s ease-out infinite;
}

.mic-btn.wake .mic-ring:nth-child(2) {
  animation-delay: 0.3s;
}

.mic-btn.wake .mic-ring:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes ring-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* Voice Transcript */
.voice-transcript {
  min-width: 250px;
  text-align: right;
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.voice-transcript.visible {
  opacity: 1;
}

/* ============================================
   Command Overlay
   ============================================ */

.command-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.command-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  text-align: center;
}

/* Waveform Animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 80px;
  margin-bottom: 30px;
}

.wave-bar {
  width: 8px;
  height: 20px;
  background: var(--accent);
  border-radius: 4px;
  animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { height: 20px; }
  50% { height: 60px; }
}

.overlay-text {
  font-family: 'Unbounded', sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 15px;
  min-height: 44px;
}

.overlay-hint {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(20, 20, 32, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal),
              visibility var(--transition-normal),
              transform var(--transition-normal);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 40px var(--accent-glow);
}

.toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.toast-icon {
  font-size: 48px;
}

.toast-content {
  text-align: left;
}

.toast-text {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.toast-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================
   Notification
   ============================================ */

.notification {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal),
              visibility var(--transition-normal),
              transform var(--transition-normal);
}

.notification.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Responsive (TV / Large Screens)
   ============================================ */

@media (min-width: 1920px) {
  :root {
    --header-height: 100px;
    --footer-height: 120px;
    --tile-gap: 30px;
  }

  .header-title { font-size: 28px; }
  .header-time { font-size: 36px; }
  .tile-icon { font-size: 72px; }
  .tile-name { font-size: 22px; }
  .tile-desc { font-size: 16px; }
  .mic-btn { width: 80px; height: 80px; }
}

/* ============================================
   Author Badge
   ============================================ */

.author-badge {
  position: fixed;
  bottom: 100px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  z-index: 10;
  opacity: 0.6;
  transition: opacity var(--transition-normal),
              color var(--transition-normal);
}

.author-badge:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.author-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.author-text {
  white-space: nowrap;
}

/* ============================================
   Content Player Overlay
   ============================================ */

.player-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 500;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.player-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.player-back {
  background: var(--bg-surface);
  border: 1px solid var(--text-muted);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.player-back:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
}

.player-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  color: var(--text-primary);
}

.player-controls {
  display: none; /* Hidden - using custom controls in video player */
}

.player-control {
  width: 50px;
  height: 50px;
  background: var(--bg-surface);
  border: 1px solid var(--text-muted);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.player-control:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  transform: scale(1.1);
}

.player-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.player-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Full-width container for video player */
.player-content > .video-player-container {
  width: 100%;
  height: 100%;
}

.player-voice-hint {
  display: none; /* Hidden - using hints inside player content */
}

/* Player Menu */
.player-menu {
  text-align: center;
  padding: 60px 40px;
  max-width: 500px;
  margin: 0 auto;
}

.player-menu-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.player-menu-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.player-menu-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.player-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.player-menu-btn {
  padding: 18px 30px;
  font-family: inherit;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.player-menu-btn.primary {
  background: linear-gradient(135deg, var(--accent), #8b7cf7);
  color: white;
}

.player-menu-btn.primary:hover {
  transform: scale(1.03);
}

.player-menu-btn:not(.primary):not(.secondary) {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--text-muted);
}

.player-menu-btn:not(.primary):not(.secondary):hover {
  border-color: var(--accent);
}

.player-menu-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--text-muted);
}

.player-menu-btn.secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.player-menu-hint {
  font-size: 14px;
  color: var(--text-muted);
}

.player-search-input {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.player-search-input input {
  flex: 1;
  padding: 15px 20px;
  font-family: inherit;
  font-size: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--text-muted);
  border-radius: 12px;
  color: var(--text-primary);
  outline: none;
}

.player-search-input input:focus {
  border-color: var(--accent);
}

.player-search-input input::placeholder {
  color: var(--text-muted);
}

.player-search-input button {
  padding: 15px 25px;
  font-size: 20px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
}

/* Search Loading */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--bg-surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Search Results */
.search-results {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 30px;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-shrink: 0;
}

.search-header h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  color: var(--text-primary);
}

.search-hint {
  font-size: 14px;
  color: var(--text-muted);
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
}

@media (max-width: 1400px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* Video Card */
.video-card {
  background: var(--bg-surface);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-card.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.3);
  transform: scale(1.03);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1a2e;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.video-info {
  padding: 15px;
}

.video-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.video-channel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.video-views {
  font-size: 12px;
  color: var(--text-muted);
}

/* Search Actions */
.search-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
  flex-shrink: 0;
}

/* Video Player Container */
.video-player-container {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  height: 100% !important;
  background: #000;
  position: absolute;
  inset: 0;
}

.video-player-container iframe,
.video-player-container #ytPlayerContainer {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
}

#ytPlayerContainer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 15px;
  background: rgba(20, 20, 32, 0.95);
  position: relative;
  z-index: 10;
}

.video-player-controls button {
  padding: 12px 24px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--text-muted);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-player-controls button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.video-player-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.video-player-controls .ctrl-back {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.video-player-hint {
  text-align: center;
  padding: 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface);
}

/* Mobile / Small Screens */
@media (max-width: 1024px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tiles-container {
    padding: 20px;
  }

  .header, .voice-bar {
    padding: 0 20px;
  }
}

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

  .header-right {
    gap: 15px;
  }

  .header-date {
    display: none;
  }

  .voice-status, .voice-transcript {
    display: none;
  }
}

/* ============================================
   Voice Recognition Indicator
   ============================================ */

.voice-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.voice-indicator.active {
  opacity: 1;
}

/* Soft glow at top */
.voice-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.voice-indicator.active .voice-glow {
  opacity: 1;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* The orb (circle) */
.voice-orb {
  position: relative;
  width: 60px;
  height: 60px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: orbPulse 1.5s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.4); opacity: 0; }
}

.voice-core {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow:
    0 0 20px var(--accent-glow),
    0 0 40px var(--accent-glow),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  animation: coreGlow 2s ease-in-out infinite;
}

@keyframes coreGlow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow); }
  50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow), 0 0 80px var(--accent-glow); }
}

/* Transcript text below orb */
.voice-text {
  margin-top: 15px;
  padding: 10px 25px;
  background: rgba(20, 20, 32, 0.95);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 25px;
  font-size: 16px;
  color: var(--text-primary);
  max-width: 500px;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.voice-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Recording state - more intense */
.voice-indicator.recording .voice-core {
  animation: coreRecording 0.8s ease-in-out infinite;
}

.voice-indicator.recording .voice-glow {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
}

.voice-indicator.recording .voice-pulse {
  background: #ef4444;
  animation: orbPulseRecording 1s ease-in-out infinite;
}

@keyframes coreRecording {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes orbPulseRecording {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.6); opacity: 0; }
}

/* Wake mode - listening for command */
.voice-indicator.wake .voice-core {
  background: linear-gradient(135deg, #00cec9 0%, #6c5ce7 100%);
}

.voice-indicator.wake .voice-glow {
  background: radial-gradient(ellipse at center, rgba(0, 206, 201, 0.4) 0%, transparent 70%);
}

.voice-indicator.wake .voice-pulse {
  background: #00cec9;
}

/* ============================================
   Music Player (Yandex Music)
   ============================================ */

/* Music Results Grid */
.music-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  height: 100%;
  overflow-y: auto;
}

.music-results h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.music-results p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1000px;
  padding-bottom: 40px;
}

.music-item {
  background: var(--bg-surface);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast);
  border: 2px solid transparent;
}

.music-item:hover,
.music-item:focus {
  background: var(--bg-surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.music-item-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-surface-hover);
}

.music-item-info {
  padding: 12px;
}

.music-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.music-item-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-item-index {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.music-item {
  position: relative;
}

/* Music Player View (full player) */
.music-player-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.music-player-cover {
  width: 300px;
  height: 300px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px;
}

.music-player-info {
  margin-bottom: 30px;
}

.music-player-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.music-player-artist {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Progress Bar */
.music-progress-container {
  width: 100%;
  max-width: 500px;
  margin-bottom: 30px;
}

.music-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.music-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.music-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Music Controls */
.music-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.music-control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.music-control-btn:hover {
  background: var(--bg-surface-hover);
  transform: scale(1.1);
}

.music-control-btn.primary {
  width: 70px;
  height: 70px;
  background: var(--accent);
  font-size: 28px;
}

.music-control-btn.primary:hover {
  background: #7d6ef0;
  box-shadow: 0 0 30px var(--accent-glow);
}

/* Music back button */
.music-back-btn {
  position: absolute;
  top: 100px;
  left: 30px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.music-back-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Music loading state */
.music-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.music-loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bg-surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.music-loading-text {
  color: var(--text-secondary);
  font-size: 16px;
}

/* Music error state */
.music-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 20px;
}

.music-error-icon {
  font-size: 60px;
}

.music-error-text {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 400px;
}

/* Input for music search */
.music-search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.music-search-icon {
  font-size: 80px;
  margin-bottom: 30px;
}

.music-search-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 28px;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.music-search-desc {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 30px;
  max-width: 400px;
}

.music-search-input {
  width: 100%;
  max-width: 400px;
  padding: 15px 20px;
  background: var(--bg-surface);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 18px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.music-search-input:focus {
  border-color: var(--accent);
}

.music-search-input::placeholder {
  color: var(--text-muted);
}

.music-voice-hint {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Music queue indicator */
.music-queue-info {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Music player cover container */
.music-player-view .music-player-cover {
  width: 300px;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}

.music-player-view .music-player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-cover-large {
  font-size: 100px;
}

/* Music player progress */
.music-player-progress {
  width: 100%;
  max-width: 400px;
  margin-bottom: 25px;
}

.music-player-progress .progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.music-player-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.music-player-progress .progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Music player buttons */
.music-player-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.music-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.music-btn:hover {
  background: var(--bg-surface-hover);
  transform: scale(1.1);
}

.music-btn.primary {
  width: 70px;
  height: 70px;
  background: var(--accent);
  font-size: 28px;
}

.music-btn.primary:hover {
  background: #7d6ef0;
  box-shadow: 0 0 30px var(--accent-glow);
}

/* Music player album info */
.music-player-album {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Music hint */
.music-hint {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Music controls row in player */
.music-player-view ~ .music-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ============================================
   Listening Indicator (NEW - Redesign)
   ============================================ */

.header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.listening-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 40px;
}

/* Default line state (idle) */
.indicator-line {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  transition: all 0.4s ease;
}

/* Sound wave bars (hidden by default) */
.indicator-bars {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.indicator-bar {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.1s ease;
}

/* Listening state */
.listening-indicator.listening .indicator-line {
  width: 400px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #7c6ef0, transparent);
  box-shadow: 0 0 20px rgba(124, 110, 240, 0.5);
  animation: indicator-pulse 2s ease-in-out infinite;
}

@keyframes indicator-pulse {
  0%, 100% { opacity: 0.7; transform: scaleX(0.95); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* Processing state (sound wave) */
.listening-indicator.processing .indicator-line {
  opacity: 0;
}

.listening-indicator.processing .indicator-bars {
  opacity: 1;
}

.listening-indicator.processing .indicator-bar {
  animation: bar-wave 0.6s ease-in-out infinite;
}

.listening-indicator.processing .indicator-bar:nth-child(1) { animation-delay: 0s; }
.listening-indicator.processing .indicator-bar:nth-child(2) { animation-delay: 0.1s; }
.listening-indicator.processing .indicator-bar:nth-child(3) { animation-delay: 0.2s; }
.listening-indicator.processing .indicator-bar:nth-child(4) { animation-delay: 0.1s; }
.listening-indicator.processing .indicator-bar:nth-child(5) { animation-delay: 0s; }

@keyframes bar-wave {
  0%, 100% { height: 8px; }
  50% { height: 24px; }
}

/* Speaking state (breathing) */
.listening-indicator.speaking .indicator-line {
  width: 300px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--success), transparent);
  box-shadow: 0 0 15px rgba(0, 206, 201, 0.4);
  animation: indicator-breathe 1.5s ease-in-out infinite;
}

@keyframes indicator-breathe {
  0%, 100% { opacity: 0.6; transform: scaleX(0.9); }
  50% { opacity: 1; transform: scaleX(1.05); }
}

/* ============================================
   Recognition Text (below header)
   ============================================ */

.recognition-text {
  position: relative;
  z-index: 10;
  text-align: center;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.recognition-text.visible {
  height: 50px;
  opacity: 1;
}

.recognition-content {
  display: inline-block;
  padding: 10px 30px;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(20, 20, 32, 0.6);
  border-radius: 25px;
  backdrop-filter: blur(10px);
}

/* ============================================
   Footer Hint (minimal)
   ============================================ */

.footer-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.footer-hint.visible {
  opacity: 1;
}

/* ============================================
   Hide old elements
   ============================================ */

.voice-indicator,
.voice-bar,
.mic-btn,
.mic-wrapper,
.text-input-wrapper,
.voice-status,
.author-badge {
  display: none !important;
}
