/* ADIÇÃO: base rem para escalonamento responsivo */
html {
  font-size: 16px;
}

/* -------------------- BODY -------------------- */
body {
  margin:0;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 1rem; /* ADIÇÃO: usar rem como unidade base */
  line-height: 1.4; /* ADIÇÃO: melhorar leitura em mobile */
  -webkit-font-smoothing: antialiased; /* ADIÇÃO: suavizar fontes em mobile */
  background: url('img/tela_fundo.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.5s;
}

/* ADIÇÃO: performance - evita background fixed em telas pequenas */
@media (max-width: 480px) {
  body {
    background-attachment: scroll;
  }
}

/* -------------------- FOOTER -------------------- */
footer {
  text-align: center;
  color: #fff;
  font-size: 14px;
  padding: 12px;
  background: rgba(0,0,0,0.7);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  position: fixed;
  bottom: 0;
  width: 100%;
}


/* -------------------- LOGIN -------------------- */
#login-page {
  display: flex;
  flex:1;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* ADIÇÃO: mobile-first - largura 100% com max-width para evitar overflow em celulares */
.login-box {
  background: rgba(255,255,255,0.95);
  padding: 2.5rem; /* 40px -> 2.5rem */
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 20rem; /* 320px */
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.login-box:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 25px rgba(0,0,0,0.4);
}

/* ADIÇÃO: responsivo para logo */
.logo-login {
  width: 7.5rem; /* 120px */
  max-width: 40%;
  margin-bottom: 1.25rem; /* 20px */
}

.login-box h2 {
  margin-bottom: 1.875rem; /* 30px */
  color: #333;
}

.input-group {
  position: relative;
  margin: 0.9375rem 0; /* 15px */
}

/* ADIÇÃO: aumentar área de toque e usar rems */
.input-group input {
  width: 100%;
  padding: 0.75rem; /* 12px */
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 0.875rem; /* 14px */
  background: none;
  min-height: 2.75rem; /* garante ~44px de altura de toque */
  box-sizing: border-box; /* ADIÇÃO: evita overflow pelo padding */
}

.input-group label {
  position: absolute;
  left: 12px;
  top: 12px;
  color: #999;
  font-size: 14px;
  pointer-events: none;
  transition: 0.2s all;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: -10px;
  left: 8px;
  font-size: 12px;
  color: #4e73df;
  background: white;
  padding: 0 4px;
}

/* ADIÇÃO: aumentar área de clique do botão e usar rems */
.login-box button {
  width: 100%;
  padding: 0.75rem; /* 12px */
  border-radius: 8px;
  border: none;
  background-color: #4e73df;
  color: white;
  font-size: 1rem; /* 16px */
  cursor: pointer;
  transition: 0.3s;
  min-height: 2.75rem; /* garante área de toque >= 44px */
}

.login-box button:hover {
  background-color: #2e59d9;
}

/* -------------------- DASHBOARD -------------------- */
#dashboard {
  display: none;
  flex:1;
  flex-direction: column;
  min-height: 100vh;
  background: rgba(244,244,249,0.95);
  animation: fadeIn 0.5s ease-in;
}

header {
  background: #4e73df;
  color: white;
  padding: 0.9375rem 1.875rem; /* 15px 30px */
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  font-size: 1.125rem; /* 18px */
  flex-wrap: wrap; /* ADIÇÃO: evitar quebra de conteúdo no mobile */
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-btn {
  cursor: pointer;
  font-weight: bold;
  color: #f8f9fc;
  transition: color 0.3s;
}

.header-btn {
  background: none;
  border: none;
  color: #f8f9fc;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s;
}

.header-btn:hover {
  color: #ff4d4d;
}

.logout-btn:hover {
  color: #ff4d4d;
}

/* -------------------- MAIN -------------------- */
/* ADIÇÃO: mobile-first layout - pilha vertical por padrão */
main {
  flex: 1;
  display: flex;
  flex-direction: column; /* mobile-first: empilhar seções */
  gap: 1.25rem; /* 20px */
  padding: 1rem; /* 16px */
  align-items: stretch;
  justify-content: flex-start;
}

/* ADIÇÃO: menu-grid mobile-first usando grid para centralizar */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem; /* 16px */
  justify-items: center;
  align-items: start;
}

.menu-item {
  text-align: center;
  cursor: pointer;
  background: white;
  padding: 1.25rem; /* 20px */
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 20rem; /* 320px - mantém consistência com login */
  transition: transform 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
  min-height: 7rem; /* ADIÇÃO: garante cartão com boa área */
}

.menu-item:hover {
  transform: scale(1.03); /* leve escala para mobile também */
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

/* ADIÇÃO: imagem menor em mobile, ampliada em desktop pelo media query abaixo */
.menu-item img {
  width: 4rem; /* 64px */
  height: 4rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.page {
  display: none;
  width: 100%;
  max-width: 900px;
  background: white;
  padding: 1.25rem; /* 20px */
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  animation: fadeIn 0.5s ease-in;
  box-sizing: border-box;
  align-self: center;
}

/*.list {
  margin-top: 0.9375rem;
  padding: 0.75rem; 
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  max-height: 350px;
  overflow-y: auto;
}*/


.list {
  display: flex;
  margin-top: 0.9375rem; /* 15px */
  padding: 0.75rem;      /* 12px */
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  display: flex;          /* Ativa o flexbox */
  flex-wrap: wrap;        /* Permite quebrar linha quando não couber */
  gap: 16px;              /* Espaço entre os itens */
  justify-content: flex-start; /* Ou center, se quiser centralizar */
  max-height: 350px;
  overflow-y: auto;
}

/* Aplica estilo a cada item dentro da lista */
#playersList > div {
  flex: 0 0 auto;         /* Evita esticar o item */
  width: 140px;           /* Largura fixa */
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Icone totem */
.player-icon {
  width: 50%;
  max-width: 50px;
  height: auto;
  object-fit: contain;
  margin-bottom: 8px;
}

/* Botão excluir */
#playersList > div button {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#playersList > div button:hover {
  background: #c0392b;
}


/* ADIÇÃO: botões compatíveis com toque (altura mínima) */
.back-btn, form button {
  margin-top: 1.25rem; /* 20px */
  padding: 0.75rem 1.125rem; /* 12px 18px */
  background: #4e73df;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: 0.3s;
  min-height: 2.75rem; /* 44px */
  font-size: 1rem;
}

.back-btn:hover, form button:hover {
  background: #2e59d9;
}

/* ADIÇÃO: estilo para input[type="file"] para ficar amigável no mobile */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* ADIÇÃO: foco visível para acessibilidade */
input:focus, select:focus, textarea:focus, button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(78,115,223,0.08);
  border-color: #4e73df;
}

/* -------------------- RESPONSIVO -------------------- */
/* ADIÇÃO: desktop layout - restaura comportamento mais espaçado para telas maiores */
@media (min-width: 769px) {
  main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px;
    justify-content: center;
  }
  .menu-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .menu-item {
    width: 160px;
    max-width: none;
    padding: 25px;
    min-height: auto;
  }
  .menu-item img {
    width: 80px;
    height: 80px;
  }
  .page {
    width: 100%;
    padding: 25px;
  }
}

/* -------------------- RESPONSIVO -------------------- */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
  }
  .menu-item { width: 100%; max-width: 300px; }
  .page { width: 100%; padding: 15px; }
}

/* -------------------- RESPONSIVO PEQUENO -------------------- */
@media (max-width: 480px) {
  .login-box { width: 90%; padding: 1.5625rem; /* 25px */ }
  .menu-item img { width: 3.25rem; height: 3.25rem; } /* 52px */
  html { font-size: 15px; } /* leve redução para telas muito pequenas */
}

/* -------------------- ANIMAÇÕES -------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px);}
  to { opacity: 1; transform: translateY(0);}
}

/* TESTANDO MIDIAS EM FORMATO DE MINIATURAS */
.midia-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}

.midia-thumbnail {
  position: relative;
  width: 150px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  overflow: hidden;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.midia-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: cover;
  cursor: pointer;
  border-radius: 3px;
  transition: transform 0.2s ease-in-out;
  
}

/*.midia-thumbnail img {
  transform: rotate(90deg);
  width: 130px;   
  height: 100px;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}*/

.midia-thumbnail img:hover {
  transform: scale(1.05);
}

.midia-info {
  font-size: 12px;
  color: #555;
  margin: 6px 0;
  text-align: center;
}

.midia-thumbnail .delete-btn {
  background-color: #e74c3c;
  border: none;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.midia-thumbnail .delete-btn:hover {
  background-color: #c0392b;
}

button.delete-btn {
  background-color: #e74c3c;
  border: none;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

button.delete-btn:hover {
  background-color: #c0392b;
}
/* Ícone do player como miniatura */
/*.player-icon {
  width: 100%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 8px;
}*/



