/*
 * style.css - Ranking de Filmes (Tema Preto e Vermelho)
 * Responsivo e com sidebar colapsável no mobile
 */

/* --- Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #111;
  color: #ccc;
  line-height: 1.6;
}

/* --- Links --- */
a {
  color: #e50914;
  text-decoration: none;
  transition: 0.3s;
}
a:hover {
  color: #ff4d4f;
}

/* --- Header --- */
#header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 15px;
  background: linear-gradient(to right, #000, #1a0000);
  border-bottom: 2px solid #e50914;
  z-index: 1000;
}

.logo h1 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 5px;
}

/* Menu principal */
.main-nav ul {
  display: flex;
  flex-wrap: wrap; /* permite quebrar linha se necessário */
  gap: 10px;
}
.main-nav li {
  list-style: none;
}
.main-nav a {
  display: block;
  padding: 5px 10px;
  color: #ccc;
  font-size: 0.9rem;
  white-space: nowrap;
}
.main-nav a:hover {
  color: #e50914;
}

/* --- Container principal --- */
#main-container {
  display: flex;
  flex-direction: row;
  padding-top: 80px; /* espaço suficiente para header fixo */
}

/* --- Sidebar --- */
#sidebar {
  width: 250px;
  background: #0d0d0d;
  padding: 20px 15px;
  border-right: 1px solid #330000;
  transition: all 0.3s ease;
}

#sidebar h2 {
  color: #e50914;
  margin-bottom: 10px;
  font-size: 1.3rem;
  border-bottom: 1px dashed #333;
  padding-bottom: 5px;
}

#sidebar ol {
  list-style: none;
}

#sidebar a {
  display: block;
  color: #ccc;
  padding: 5px;
  border-radius: 3px;
}

#sidebar a:hover {
  background: #330000;
  color: #fff;
}

/* --- Conteúdo principal --- */
#main-content {
  flex: 1;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

#main-content h2 {
  color: #e50914;
  margin-bottom: 20px;
  text-align: center;
}

/* --- Ranking --- */
.movie-ranking {
  background: linear-gradient(to bottom, #1a1a1a, #141414);
  border: 1px solid #330000;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #333;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.ranking-header h3 {
  color: #fff;
  font-size: 1.4rem;
}

.rank-number {
  font-weight: bold;
  color: #e50914;
  background: #330000;
  padding: 5px 10px;
  border-radius: 5px;
}

.movie-poster {
  width: 100%;
  max-width: 300px;
  margin-top: 15px;
  border: 2px solid #e50914;
  box-shadow: 0 0 10px rgba(229,9,20,0.5);
  border-radius: 6px;
}

/* --- Rodapé --- */
.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid #330000;
}

/* --- Responsividade --- */

/* Tablets e telas médias */
@media (max-width: 900px) {
  #main-container {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #330000;
    margin-bottom: 20px;
  }
}

/* Botão de menu mobile */
#menu-toggle {
    display: none; /* só aparece em telas pequenas */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #e50914;
    cursor: pointer;
}

/* Menu responsivo */
@media (max-width: 600px) {
    #menu-toggle { display: block; }

    .main-nav {
        display: none; /* esconde por padrão */
        width: 100%;
        flex-direction: column;
        margin-top: 10px;
    }

    .main-nav.active {
        display: flex; /* mostra quando ativo */
    }

    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .movie-poster {
        max-width: 100%;
    }
}
