/* CSS בסיסי */
:root {
  --primary-color: #cc0000;
  --primary-dark: #a30000;
  --background-color: #f9f9f9;
  --surface-color: #ffffff;
  --text-primary: #212121;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
}

/* ===== SPLASH SCREEN ===== */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  padding: 20px;
}

/* אנימציית לוגו */
.logo-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
}

.splash-logo {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: float 3s ease-in-out infinite;
}

/* טבעות פולס */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 2px solid rgba(204, 0, 0, 0.3);
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}

.pulse-ring.delay-1 {
  animation-delay: 0.5s;
}

.pulse-ring.delay-2 {
  animation-delay: 1s;
}

/* טקסט */
.splash-title {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.splash-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* בר טעינה */
.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #cc0000, #ff3333);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* אנימציות */
@keyframes float {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes pulse {
  0% {
    width: 120px;
    height: 120px;
    opacity: 1;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

/* ===== HEADER ===== */
.logo-container {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

.header-title {
  color: white;
  font-size: 2rem;
  margin: 0;
}

/* ===== MAIN CONTENT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== SEARCH BOX ===== */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-box input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-box button {
  padding: 12px 25px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: 0.3s;
  min-width: 80px;
}

.search-box button:hover {
  background: var(--primary-dark);
}

.search-box button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== PLAYER CONTAINER ===== */
#player-container {
  margin-bottom: 30px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  min-height: 300px;
}

.player-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 20px;
}

#player-container iframe {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* ===== RESULTS ===== */
#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.video-item {
  background: var(--surface-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.video-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.video-title {
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* סרטון פעיל */
.video-item.active {
  border: 2px solid var(--primary-color);
}

.video-item.active::before {
  content: "▶️";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(204, 0, 0, 0.9);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
}

/* ===== LOADING & EMPTY STATES ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 18px;
  grid-column: 1 / -1;
}

.empty-list {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 18px;
  grid-column: 1 / -1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .search-box button {
    width: 100%;
  }
  
 #player-container iframe {
    height: 300px;
  }
  
  #results {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }
  
  .video-item img {
    height: 100px;
  }
  
  .splash-title {
    font-size: 2rem;
  }
  
  .logo-animation {
    width: 100px;
    height: 100px;
  }
  
  .splash-logo {
    width: 80px;
    height: 80px;
  }
  
  @keyframes pulse {
    0% {
      width: 100px;
      height: 100px;
      opacity: 1;
    }
    100% {
      width: 160px;
      height: 160px;
      opacity: 0;
    }
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 1.5rem;
  }
  
  #results {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .video-title {
    font-size: 13px;
    padding: 10px;
  }
  
  .splash-title {
    font-size: 1.8rem;
  }
  
  .splash-subtitle {
    font-size: 1rem;
  }
}
