* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #121212;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.light {
  background-color: #f5f5f5;
  color: #121212;
}

.theme-toggle {
  margin-bottom: 10px;
}

#themeBtn {
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  background-color: #bb86fc;
  color: #121212;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#themeBtn:hover { background-color: #9a5edb; }

.container {
  width: 100%;
  max-width: 600px;
  background-color: #1e1e1e;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  transition: background-color 0.3s ease;
}

body.light .container { background-color: #fff; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#searchInput {
  flex: 1;
  padding: 15px;
  border-radius: 50px;
  border: 2px solid #333;
  background-color: #121212;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#searchInput:focus { border-color: #bb86fc; }
body.light #searchInput { background-color: #fff; color: #121212; border: 2px solid #ccc; }

#searchBtn {
  padding: 15px 25px;
  border-radius: 50px;
  border: none;
  background-color: #bb86fc;
  color: #121212;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#searchBtn:hover { background-color: #9a5edb; }
body.light #searchBtn { background-color: #6200ee; color: #fff; }
body.light #searchBtn:hover { background-color: #4500b5; }

.spinner {
  border: 6px solid #2a2a2a;
  border-top: 6px solid #bb86fc;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

.no-results { margin: 20px 0; font-size: 16px; color: #bbb; }

.video-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.video-card {
  background-color: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.video-card:hover { transform: translateY(-5px); }
.video-card img { width: 100%; height: auto; }
.video-card .info { padding: 10px; }
.video-card .info h3 { font-size: 14px; margin-bottom: 5px; }
.video-card .info p { font-size: 12px; color: #bbb; }

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
}

.close {
  position: absolute;
  top: 10px; right: 15px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  font-weight: bold;
}

@media (max-width: 500px) {
  #searchInput, #searchBtn { padding: 12px; font-size: 14px; }
}
