/* ========== VARIABLES & RESET ========== */
:root {
  --primary: #e50914;
  --secondary: #221f1f;
  --dark: #171717;
  --text: #333;
  --radius: 8px;
  --shadow: 0 5px 20px rgba(0,0,0,.2);
  --transition: all .3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #0f0f0f;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: min(95%, 1200px);
  margin: 0 auto;
  padding: 0 10px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.nav-button {
    display: flex;
    align-items: center;
}

.cineverse-button {
    background-color: #ff1500;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cineverse-button:hover {
    color: #ff1500;
    background-color: #ffffff;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.3;
}

/* ========== HEADER ========== */
header {
  background: var(--dark);
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.profile-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(229,9,20,.4);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.profile-image img:hover {
  transform: scale(1.1);
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.7)), url('cinema-background.jpg') center/cover;
  color: white;
  text-align: center;
  padding: 100px 0 40px;
  margin-bottom: 30px;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  font-weight: 700;
  padding: 0 15px;
}

.hero p {
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.9;
  padding: 0 15px;
}

/* ========== CONTENT SECTION ========== */
.content-section {
  margin-bottom: 40px;
  background: #1a1a1a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  background: var(--secondary);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.section-header h2 {
  font-size: 1.4rem;
  color: white;
  font-weight: 600;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars {
  color: #ffc107;
}

.rating-text {
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
}

.content-type .badge {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
}

.content-card {
  display: flex;
  flex-wrap: wrap;
}

.media-container {
  flex: 1;
  min-width: 100%;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poster {
  width: 100%;
  max-width: 250px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,.5);
  margin-bottom: 20px;
}

.poster img {
  width: 100%;
  transition: var(--transition);
}

.poster:hover img {
  transform: scale(1.05);
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  padding: 15px;
  color: white;
  opacity: 0;
  transition: var(--transition);
}

.poster:hover .overlay {
  opacity: 1;
}

.movie-info p {
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.play-button {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-weight: 500;
  width: 100%;
  max-width: 250px;
}

.play-button i {
  font-size: 1.3rem;
  margin-right: 8px;
}

.play-button:hover {
  background: #f50914;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(229,9,20,.3);
}

.review-summary {
  flex: 2;
  min-width: 100%;
  padding: 20px 15px;
  color: #e5e5e5;
}

.review-summary h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.review-summary p {
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #333;
  color: #ccc;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* ========== SUGGESTIONS ========== */
.content-section:has(.badge[data-text="Recommendations"]) {
  border-left: 3px solid var(--primary);
}

.suggestions-list {
  margin: 20px 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* Main details container styling */
.suggestions-list details {
  background: #222;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.suggestions-list details:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,.4);
}

/* When details are open */
.suggestions-list details[open] {
  border-left: 3px solid var(--primary);
  background: #252525;
}

/* Summary styling (the header part) */
.suggestions-list summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  position: relative;
  background: linear-gradient(to right, #222, #2a2a2a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.suggestions-list summary:hover {
  background: linear-gradient(to right, #252525, #303030);
}

/* Remove default arrow */
.suggestions-list summary::-webkit-details-marker {
  display: none;
}

/* Custom arrow/icon styling */
.suggestions-list summary::after {
  content: "\f105";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--primary);
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.suggestions-list details[open] summary::after {
  content: "\f107";
  transform: rotate(0deg);
}

/* Add a genre icon before each category */
.suggestions-list summary::before {
  content: "";
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background-color: rgba(229, 9, 20, 0.15);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--primary);
}

/* Custom icons for each genre - these would need to be adjusted for your specific categories */
.suggestions-list details:nth-child(1) summary::before { content: "\f2bd"; } /* Lokiverse - user */
.suggestions-list details:nth-child(2) summary::before { content: "\f52b"; } /* Mystery - magnifying glass */
.suggestions-list details:nth-child(3) summary::before { content: "\f6e2"; } /* Horror - ghost */
.suggestions-list details:nth-child(4) summary::before { content: "\f54a"; } /* Action - fist */
.suggestions-list details:nth-child(5) summary::before { content: "\f21b"; } /* Thriller - user-secret */
.suggestions-list details:nth-child(6) summary::before { content: "\f599"; } /* Comedy - laugh  */
.suggestions-list details:nth-child(7) summary::before { content: "\f02d"; } /* True Stories - book */
.suggestions-list details:nth-child(8) summary::before { content: "\f756"; } /* Zombie - skull */
.suggestions-list details:nth-child(9) summary::before { content: "\f11b"; } /* Game-Themed - gamepad */
.suggestions-list details:nth-child(10) summary::before { content: "\f3d1"; } /* Financial - money-bill */
.suggestions-list details:nth-child(11) summary::before { content: "\f602"; } /* Superhero - mask */
.suggestions-list details:nth-child(12) summary::before { content: "\f302"; } /* Anime - pencil */
.suggestions-list details:nth-child(13) summary::before { content: "\f3fa"; } /* South Drama Movies - film */

/* Content styling (the list part) */
.suggestions-list details[open] > summary {
  margin-bottom: 0;
  border-bottom: 1px solid #333;
}

.suggestions-list ul {
  list-style: none;
  padding: 15px;
  background: #252525;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.suggestions-list li {
  background: #333;
  color: #e5e5e5;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
}

.suggestions-list li::before {
  content: "\f008";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.7rem;
  margin-right: 8px;
  color: var(--primary);
  opacity: 0.8;
}

.suggestions-list li:hover {
  background: #3a3a3a;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,.2);
  color: white;
}

/* ========== FOOTER ========== */
footer {
  background: var(--dark);
  color: white;
  padding: 40px 0 20px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-about h3,
.footer-contact h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.footer-about p,
.footer-contact li {
  color: #bbb;
  font-size: 0.9rem;
}

.footer-contact ul {
  list-style: none;
}

.footer-contact li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.footer-contact i {
  margin-right: 8px;
  color: var(--primary);
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #777;
  font-size: 0.85rem;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (min-width: 576px) {
  .container {
    width: 90%;
    padding: 0 15px;
  }

  .logo h1 {
    font-size: 1.8rem;
  }

  .hero h2 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }
}

@media (min-width: 768px) {
  nav {
    padding: 15px 0;
  }

  .hero {
    padding: 120px 0 60px;
    margin-bottom: 40px;
  }

  .hero h2 {
    font-size: 3rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  .section-header {
    padding: 20px 25px;
  }

  .media-container,
  .review-summary {
    min-width: 300px;
  }

  .content-card {
    flex-direction: row;
  }

  .play-button {
    width: auto;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer-about,
  .footer-contact {
    flex: 1;
    min-width: 250px;
  }

  .overlay {
    opacity: 0;
  }
  
  .suggestions-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .overlay {
    opacity: 1;
    padding: 12px;
    font-size: 0.9rem;
  }

  .play-button,
  .tag {
    min-height: 44px;
  }

  .footer-contact li,
  .tag {
    margin-bottom: 15px;
  }
  
  .suggestions-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .suggestions-list {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 320px) {
  .container {
    width: 100%;
    padding: 0 10px;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }
}

/* iOS Safe Area */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}