:root {
  --primary-color: #ff9800;
  --primary-hover: #e68900;
  --background-dark: #1e1e1e;
  --card-background: #2c2c2c;
  --text-light: #f5f5f5;
  --accent-yellow: #ffeb3b;
  --trailer-background: #191919;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background-dark);
  color: var(--text-light);
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header .credit {
  text-align: center;
  font-size: 0.95rem;
  color: #aaa;
  margin-top: 8px;
}

/* New class for header links styled like footer, but yellow */
.highlight-link {
  color: #ffd700; /* bright yellow */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.highlight-link:hover,
.highlight-link:focus {
  color: #fff176; /* lighter yellow on hover */
  outline: none;
}


h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.tagline {
  font-style: italic;
  opacity: 0.8;
  margin-bottom: 20px;
}

.search-container {
  position: relative;
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  width: 100%;
}

#searchBox {
  flex: 1;
  padding: 15px;
  font-size: 16px;
  border: none;
  border-radius: 8px 0 0 8px;
  background-color: #151414;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#searchBtn {
  padding: 0 25px;
  font-size: 16px;
  font-weight: bold;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

#searchBtn:hover {
  background-color: var(--primary-hover);
}

#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: none;
}

.suggestion-item {
  padding: 10px 15px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

.suggestion-item img {
  width: 40px;
  height: 60px;
  margin-right: 10px;
  object-fit: cover;
}

.suggestion-details {
  flex: 1;
}

.suggestion-title {
  font-weight: bold;
}

.suggestion-year {
  font-size: 0.8rem;
  opacity: 0.7;
}

#movieDetails {
  background-color: var(--card-background);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: none;
  margin-top: 20px;
}

.movie-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.poster-container {
  padding: 20px;
  display: flex;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
}

.poster-container img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.info-container {
  padding: 25px;
}

.movie-title {
  font-size: 1.8rem;
  margin-bottom: 5px;
  color: var(--accent-yellow);
}

.movie-year {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.meta-item {
  padding: 5px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.9rem;
}

.rating {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.rating-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 5px;
}

.rating-count {
  font-size: 0.9rem;
  opacity: 0.7;
}

.movie-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.error-message {
  text-align: center;
  padding: 20px;
  color: #ff6b6b;
}

.loader {
  display: none;
  text-align: center;
  padding: 20px;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (min-width: 768px) {
  .movie-grid {
    grid-template-columns: 300px 1fr;
  }
  
  .poster-container {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  #searchBox {
    border-radius: 8px 8px 0 0;
  }
  
  #searchBtn {
    border-radius: 0 0 8px 8px;
    padding: 12px;
  }
  
  .meta-item {
    font-size: 0.8rem;
  }
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: #121212;
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.container {
  max-width: 720px;
  width: 100%;
  background: #1f1f1f;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

header h1 {
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 4px;
  color: #ff3c00;
  text-align: center;
  user-select: none;
}

.tagline {
  font-weight: 400;
  font-size: 1.15rem;
  text-align: center;
  color: #ccc;
  margin-bottom: 20px;
}

.search-container {
  width: 100%;
  position: relative;
}

.search-box {
  display: flex;
  gap: 12px;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #333;
  color: #eee;
  transition: background-color 0.3s ease;
}

.search-box input::placeholder {
  color: #999;
}

.search-box input:focus {
  background: #444;
  box-shadow: 0 0 8px #ff3c00;
}

.search-box button {
  background: #ff3c00;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: background-color 0.25s ease;
  user-select: none;
}

.search-box button:hover,
.search-box button:focus {
  background: #e63500;
  outline: none;
}

.suggestions {
  position: absolute;
  top: 48px;
  width: 100%;
  background: #222;
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.75);
  z-index: 10;
}

.suggestions div {
  padding: 10px 16px;
  cursor: pointer;
  color: #eee;
  transition: background-color 0.2s ease;
}

.suggestions div:hover {
  background: #ff3c00;
  color: #fff;
}

.loader {
  display: none;
  justify-content: center;
  margin: 40px 0;
}

.loader.active {
  display: flex;
}

.spinner {
  border: 5px solid #333;
  border-top: 5px solid #ff3c00;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

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

.movie-details {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  color: #ddd;
  box-shadow: inset 0 0 8px #111;
  user-select: text;
}

.movie-details h2 {
  margin-bottom: 8px;
  color: #ff3c00;
}

.movie-details p {
  line-height: 1.5;
  margin-bottom: 10px;
}

footer {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  user-select: none;
}

footer a {
  color: #ff3c00;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

footer a:hover,
footer a:focus {
  color: #ffa066;
  outline: none;
}
