/* === FlickPick Streaming Service CSS === */

/* ========================== */
/*         RESET + FONTS      */
/* ========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* ========================== */
/*           THEME            */
/* ========================== */
:root {
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-card: #2a2a2a;
  --accent-color: #e50914;
  --accent-hover: #f40612;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --border-color: rgba(255, 255, 255, 0.1);
  --sidebar-width: 280px;
  --sidebar-collapsed: 70px;
}

/* ========================== */
/*           BODY             */
/* ========================== */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

body {
  display: flex;
}

/* ========================== */
/*          SIDEBAR           */
/* ========================== */
.sidebar {
  width: var(--sidebar-collapsed);
  height: 100vh;
  background: var(--bg-secondary);
  padding: 20px 0;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border-color);
  transition: width 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
  overflow-y: hidden;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar.expanded {
  width: var(--sidebar-width);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
  overflow-y: visible !important;
}

/* Toggle Button */
.toggle-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 10px;
  margin-bottom: 30px;
  transition: color 0.2s, transform 0.2s;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.toggle-btn:hover {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
}

/* Close Button */
.close-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  width: 40px;
  height: 40px;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.sidebar.expanded .close-btn {
  display: block;
}

.sidebar.sidebar.expanded .toggle-btn {
  display: none;
}

/* Sidebar Icons */
.sidebar-icons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  padding: 0 10px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar.expanded .sidebar-icons {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.sidebar-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.sidebar-icon.active {
  color: var(--accent-color);
  background: rgba(229, 9, 20, 0.15);
}

/* Sidebar Content */
.sidebar-content {
  opacity: 0;
  visibility: hidden;
  width: 100%;
  padding: 0 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  position: absolute;
  top: 80px;
}

.sidebar.expanded .sidebar-content {
  opacity: 1;
  visibility: visible;
}

.menu-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin: 30px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.menu-list {
  list-style: none;
  margin-bottom: 20px;
}

.menu-list li {
  margin-bottom: 5px;
}

.menu-list a,
.menu-list button {
  display: block;
  width: 100%;
  color: var(--text-secondary);
  padding: 12px 15px;
  border-radius: 8px;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-list a:hover,
.menu-list button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateX(5px);
}

.menu-list button.active {
  background: rgba(229, 9, 20, 0.15);
  color: var(--accent-color);
}

/* Star Filter */
.sidebar-star-filter {
  padding: 0;
}

.sidebar-star-filter label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.sidebar-star-filter select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-star-filter select:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-star-filter select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

/* ========================== */
/*         CONTAINER          */
/* ========================== */
.container {
  margin-left: var(--sidebar-collapsed);
  width: 100%;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  padding: 0;
}

.sidebar.expanded~.container {
  margin-left: var(--sidebar-width);
}

.content-container {
  max-width: none;
  margin: 0;
  padding: 40px 20px 40px 20px;
  width: 100%;
}

/* ========================== */
/*        SEARCH BAR          */
/* ========================== */
.movie-search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.movie-search {
  width: 100%;
  max-width: 600px;
  padding: 15px 20px;
  border-radius: 50px;
  border: 2px solid transparent;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.movie-search::placeholder {
  color: var(--text-secondary);
}

.movie-search:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}

/* ========================== */
/* MOVIE SECTION GRID LAYOUT  */
/* ========================== */
/* Main movie section grid */
#movies-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  justify-content: center;
  padding: 40px 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Each movie card */
.movie-item {
  background: #1b1b1b;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.movie-item:hover {
  transform: scale(1.05);
  z-index: 10;
}

.movie-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

.movie-item:hover img {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.movie-item h3 {
  font-size: 0.95rem;
  margin-top: 10px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 5px;
}

/* 🎬 Movie Card Actions */
.movie-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* fade-in buttons on hover */
.movie-item:hover .movie-actions {
  opacity: 1;
  transform: translateY(0);
}

/* Trailer Button */
.trailer-btn {
  background: linear-gradient(135deg, #e50914, #b00610);
  border: none;
  color: white;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(229, 9, 20, 0.3);
}

.trailer-btn:hover {
  background: linear-gradient(135deg, #ff0f1e, #d40813);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.5);
}

/* Favorite Button */
.fav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  color: #ccc;
}

.fav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* 🎥 Recommended Movies Section */
.recommendations {
  width: 100%;
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
  background: rgba(22, 22, 22, 0.8);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  max-height: 80vh;
}

/* Grid layout for recommended movies */
.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  justify-content: center;
  align-items: start;
}

/* Recommended movie items */
.recommendation-grid .movie-item {
  background: #1b1b1b;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: 10px;
}

.recommendation-grid .movie-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.recommendation-grid .movie-item:hover img {
  transform: scale(1.05);
}

.recommendation-grid .movie-item h3 {
  font-size: 1rem;
  color: #fff;
  margin: 10px 0 5px;
}

.recommendation-grid .movie-item span {
  font-size: 0.85rem;
  color: #999;
}

/* Buttons inside recommendations smaller */
.recommendation-grid .movie-actions button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Scrollable area if too many recommendations */
.recommendations::-webkit-scrollbar {
  width: 8px;
}

.recommendations::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 10px;
}

.recommendations::-webkit-scrollbar-thumb:hover {
  background: #666;
}


/* ========================== */
/*        RESPONSIVE          */
/* ========================== */
@media (max-width: 1400px) {
  #movies-section {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 1024px) {
  .content-container {
    padding: 30px 30px;
  }

  #movies-section {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 250px;
  }

  .content-container {
    padding: 25px 20px;
  }

  #movies-section {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .movie-search {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .sidebar.expanded {
    width: 100vw;
  }

  .sidebar.expanded~.container {
    margin-left: 100vw;
  }

  .content-container {
    padding: 20px 15px;
  }

  #movies-section {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .movie-item h3 {
    font-size: 0.85rem;
  }

  .movie-item span {
    font-size: 0.75rem;
  }
}