/* CSS Document */
:root {
  --primary: #5c67f2;
  --bg-light: #f9f9f9;
  --bg-dark: #1e1e1e;
  --text-light: #fff;
  --text-dark: #333;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 20px;
   text-align: center; 
  transition: all 0.3s;
}

.dark-mode {
  background: var(--bg-dark);
  color: var(--text-light);
}

h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  /* justify-items: left;
  text-align: left; */
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}

.search-box {
  margin-bottom: 20px;
}

input {
  padding: 10px;
  width: auto;
  max-width: 80%; 
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
}

button {
  padding: 10px 18px;
  font-size: 1em ;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 5px;
  transition: background 0.3s;
}

button:hover {
  background: #4a56d1;
}

#toggleTheme {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  color: var(--primary);
  border-radius: 50%;

  border: none;
  font-size: 1em;
  height: 40px;
  width: 40px;
}

.results {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
margin-top: 20px;
}

.video-btn {
display: flex;
align-items: center;
background: #fff;
border-radius: 12px;
padding: 10px 15px;
width: 100%;
max-width: 600px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
transition: transform 0.2s, background 0.2s;
cursor: pointer;
overflow: hidden;
border: 1px solid #e5e5e5;
}

.video-btn:hover {
background: #f3f3f3;
transform: translateY(-2px);
}

.video-btn img {
width: 40px;
height: 40px;
border-radius: 8px;
object-fit: cover;
margin-right: 15px;
}

.video-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: left;
}

.video-title {
font-weight: 300;
font-size: 13px;
margin-bottom: 4px;
color: #111;
justify-content: left;
}

.video-channel {
font-size: 0.85rem;
color: #666;
}


iframe {
  width: 100%;
  max-width: 300px;
  height: 400px;
  border: none;
  margin: 20px auto;
}

.timeline {
  margin-top: 10px;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

#progressBar {
  width: 100%;
}

#timeLeft {
  margin-top: 10px;
  font-size: 0.9em;
  color: #555;
}

.controls {
  margin-top: 15px;
}

.controls button {
  margin: 4px;
}

.loading {
  font-size: 1em;
  margin-top: 10px;
  color: #888;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid transparent;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#currentTitle {
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary);
  }
  to {
    text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
  }
}

.visualizer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100px;
  max-width: 600px;
  margin: 10px auto;
  gap: 4px;
}

.bar {
  width: 6px;
  height: 20px;
  background: var(--primary);
  border-radius: 4px;
  animation: bounce 1s infinite ease-in-out;
}

.bar:nth-child(1) {
  animation-delay: 0s;
}

.bar:nth-child(2) {
  animation-delay: 0.1s;
}

.bar:nth-child(3) {
  animation-delay: 0.2s;
}

.bar:nth-child(4) {
  animation-delay: 0.3s;
}

.bar:nth-child(5) {
  animation-delay: 0.4s;
}

.bar:nth-child(6) {
  animation-delay: 0.5s;
}

.bar:nth-child(7) {
  animation-delay: 0.6s;
}

.bar:nth-child(8) {
  animation-delay: 0.7s;
}

.bar:nth-child(9) {
  animation-delay: 0.8s;
}

.bar:nth-child(10) {
  animation-delay: 0.9s;
}

@keyframes bounce {
  0%,
  100% {
    height: 20px;
  }
  50% {
    height: 60px;
  }
}

.visualizer.paused .bar {
  animation-play-state: paused;
}

@media (max-width: 600px) {
  iframe {
    height: 200px;
  }

  .video-btn {
    max-width: 85%;
  }
}
.search-container {
position: relative;
display: inline-block;
}

.search-container input {
padding-right: 30px; /* space for clear button */
}

.clear-btn {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
color: #999;
cursor: pointer;
display: none;
font-size: 1.2em;
user-select: none;
margin-right: 65px;
}

footer {
margin-top: 20px;
font-size: 0.9em;
color: #888;
text-align: center;
border-radius: 5px;
border-top: 2px solid var(--primary);
}
.header {
    background: transparent;
    color: #fff;
    padding: 1rem 1.5rem;
    /* border-bottom: 1px solid #222; */
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
  }
  
  .header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
  }
  
  .header i {
    font-size: 1.8rem;
    color: #f2545b;
  }
  
  .header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
  }
  
  .header .tagline {
    font-size: 0.9rem;
    color: #aaa;
    margin-left: 0.5rem;
    font-weight: 400;
  }
  