/* Import a base stylesheet if you have one, e.g., for the sidebar */

:root {
  --primary-color: #007bff; /* A brighter, more modern blue */
  --background-dark: #141414; /* Standard streaming service background */
  --card-background: #272727;
  --dark: #111827;
  --darker: #0f172a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --focus-outline-color: var(--primary-color);
  --card-border-radius: 6px;
  --transition-speed: 0.2s;
}

body {
  /* This prevents horizontal scrollbars from the scaling effect */
  overflow-x: hidden;
}

.main-content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  height: 100vh;
  background: linear-gradient(135deg, rgb(19, 19, 19) 0%, rgba(46, 46, 46, 0.9) 100%);
}

/* --- Header Banner --- */
.category-header {
  text-align: center;
  background: linear-gradient(to right, #06b6d4, #3b82f6); /* from-cyan-500 to-blue-600 */
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.header-title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.header-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Search Bar --- */
.search-container {
  display: flex;
  align-items: center;
  background-color: var(--card-background);
  border-radius: var(--card-border-radius);
  padding: 12px 20px;
  margin-bottom: 40px;
  border: 2px solid transparent; /* Reserve space for focus border */
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: border-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.search-container .material-icons {
  margin-right: 15px;
  color: var(--text-secondary);
  font-size: 2rem;
}

#searchInput {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.5rem;
}

#searchInput::placeholder {
  color: var(--text-secondary);
}

/* Unified focus for web and TV remote */
.search-container:has(#searchInput:focus),
.search-container.focused {
  border-color: var(--focus-outline-color);
  transform: scale(1.01);
}

/* --- Results --- */
#results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
  padding: 15px 0;
}

/* Message for loading, error, or no results */
.message {
  grid-column: 1 / -1; /* Span all columns */
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-secondary);
  padding: 60px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.message .material-icons {
  font-size: 4rem;
  margin-bottom: 20px;
}

.message.error {
  color: #ff6b6b;
}

/* --- Movie Card --- */
  .movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
    aspect-ratio: 2 / 3; /* Maintain poster aspect ratio */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    background-color: #374151;
  }

  .movie-card:focus,
.movie-card.focused {
  outline: none; /* Remove default browser outline */
  transform: scale(1.1);
  z-index: 10;
  border-color: rgb(255, 255, 255); /* THE BLUE BORDER */
}

.movie-card.focusable:focus .details-overlay {
    opacity: 1;
    transform: translateY(0);
  }
  
  .poster-wrapper {
    width: 100%;
    height: 100%;
  }
  
  .poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  /* --- Focus/Hover Overlay --- */
  .details-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 100%);
    color: white;
    opacity: 0; /* Hidden by default */
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 60%;
  }
  
  .movie-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
  }
  
  .watch-button {
    background: #3b82f6; /* A solid, clear color is better for TV */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    align-self: flex-start; /* Button doesn't stretch */
  }

/* Scrollbar styling for Tizen/Webkit */
.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: var(--background-dark);
}

.main-content::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}

/* Loading animation */
@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.loading {
  animation: pulse 1.5s infinite ease-in-out;
}