@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap");

/* --- DEFINIÇÃO DAS VARIÁVEIS DE COR --- */
:root {
  --background-color: #fff;
  --text-color: #444;
  --input-field-bg: #f0f0f0;
  --input-field-text: #333;
  --input-field-icon: #acacac;
  --primary-color: #4481eb;
  --primary-color-hover: #3b71d4;
  --panel-gradient-start: #4481eb;
  --panel-gradient-end: #04befe;
  --panel-text-color: #fff;
  --social-icon-border: #333;
  --social-icon-color: #333;
}

body.dark-mode {
  --background-color: #121827;
  --text-color: #fff;
  --input-field-bg: #202940;
  --input-field-text: #fff;
  --input-field-icon: #8c95b4;
  --primary-color: #5ea1f3;
  --primary-color-hover: #4d8ad1;
  --social-icon-border: #8c95b4;
  --social-icon-color: #8c95b4;
}
/* -------------------------------------- */


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

body, input {
  font-family: "Poppins", sans-serif;
}

body {
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

.container {
  position: relative;
  width: 100%;
  background-color: var(--background-color);
  min-height: 100vh;
  overflow: hidden;
}

.forms-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.signin-signup {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 75%;
  width: 50%;
  transition: 1s 0.7s ease-in-out;
  display: grid;
  grid-template-columns: 1fr;
  z-index: 5;
}

form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0rem 5rem;
  transition: all 0.2s 0.7s;
  overflow: hidden;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

form.sign-up-form {
  opacity: 0;
  z-index: 1;
}

form.sign-in-form {
  z-index: 2;
}

.title {
  font-size: 2.2rem;
  color: var(--text-color);
  margin-bottom: 10px;
}

.input-field {
  max-width: 380px;
  width: 100%;
  background-color: var(--input-field-bg);
  margin: 10px 0;
  height: 55px;
  border-radius: 55px;
  display: grid;
  grid-template-columns: 15% 85%;
  padding: 0 0.4rem;
  position: relative;
}

.input-field i {
  text-align: center;
  line-height: 55px;
  color: var(--input-field-icon);
  transition: 0.5s;
  font-size: 1.1rem;
}

.input-field input {
  background: none;
  outline: none;
  border: none;
  line-height: 1;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--input-field-text);
}

.input-field input::placeholder {
  color: var(--input-field-icon);
  font-weight: 500;
}

.social-text {
  padding: 0.7rem 0;
  font-size: 1rem;
  color: var(--text-color);
}

.social-media {
  display: flex;
  justify-content: center;
}

.social-icon {
  height: 46px;
  width: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0.45rem;
  color: var(--social-icon-color);
  border-radius: 50%;
  border: 1px solid var(--social-icon-border);
  text-decoration: none;
  font-size: 1.1rem;
  transition: 0.3s;
}

.social-icon:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn {
  width: 150px;
  background-color: var(--primary-color);
  border: none;
  outline: none;
  height: 49px;
  border-radius: 49px;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  margin: 10px 0;
  cursor: pointer;
  transition: 0.5s;
}

.btn:hover {
  background-color: var(--primary-color-hover);
}

.panels-container {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.container:before {
  content: "";
  position: absolute;
  height: 2000px;
  width: 2000px;
  top: -10%;
  right: 48%;
  transform: translateY(-50%);
  background-image: linear-gradient(-45deg, var(--panel-gradient-start) 0%, var(--panel-gradient-end) 100%);
  transition: 1.8s ease-in-out;
  border-radius: 50%;
  z-index: 6;
}

.image {
  width: 100%;
  transition: transform 1.1s ease-in-out;
  transition-delay: 0.4s;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-around;
  text-align: center;
  z-index: 6;
}

.left-panel {
  pointer-events: all;
  padding: 3rem 17% 2rem 12%;
}

.right-panel {
  pointer-events: none;
  padding: 3rem 12% 2rem 17%;
}

.panel .content {
  color: var(--panel-text-color);
  transition: transform 0.9s ease-in-out;
  transition-delay: 0.6s;
}

.panel h3 {
  font-weight: 600;
  line-height: 1;
  font-size: 1.5rem;
}

.panel p {
  font-size: 0.95rem;
  padding: 0.7rem 0;
}

.btn.transparent {
  margin: 0;
  background: none;
  border: 2px solid var(--panel-text-color);
  width: 130px;
  height: 41px;
  font-weight: 600;
  font-size: 0.8rem;
}

.right-panel .image,
.right-panel .content {
  transform: translateX(800px);
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    height: 20px;
}

/* --- ESTILOS DO BOTÃO DE TEMA --- */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--input-field-bg);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.theme-toggle i {
    font-size: 1.5rem;
    color: var(--input-field-icon);
}

.theme-toggle .fa-sun {
    display: none;
}

body.dark-mode .theme-toggle .fa-sun {
    display: block;
}

body.dark-mode .theme-toggle .fa-moon {
    display: none;
}
/* ---------------------------------- */


/* ANIMAÇÃO */
.container.sign-up-mode:before {
  transform: translate(100%, -50%);
  right: 52%;
}
.container.sign-up-mode .left-panel .image,
.container.sign-up-mode .left-panel .content {
  transform: translateX(-800px);
}
.container.sign-up-mode .signin-signup {
  left: 25%;
}
.container.sign-up-mode form.sign-up-form {
  opacity: 1;
  z-index: 2;
}
.container.sign-up-mode form.sign-in-form {
  opacity: 0;
  z-index: 1;
}
.container.sign-up-mode .right-panel .image,
.container.sign-up-mode .right-panel .content {
  transform: translateX(0%);
}
.container.sign-up-mode .left-panel {
  pointer-events: none;
}
.container.sign-up-mode .right-panel {
  pointer-events: all;
}


/* RESPONSIVIDADE */

/* frontend/static/style.css */

/*
   ... (todo o seu CSS anterior continua aqui, não mude nada acima disto) ...
*/


/* =================================================================== */
/* RESPONSIVIDADE (SUBSTITUA TUDO ABAIXO)                  */
/* =================================================================== */

@media (max-width: 870px) {
  /* 1. CONFIGURAÇÃO GERAL DO LAYOUT MOBILE */
  
  /* Usa Flexbox para criar uma coluna vertical limpa */
  .container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    padding: 2rem 1rem;
  }
  
  /* Remove as animações e posicionamentos do modo desktop */
  .container:before {
    display: none;
  }

  .forms-container, .panels-container, .signin-signup {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
  }
  
  .signin-signup {
    padding: 2rem 0;
  }

  .panel {
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .panel .content {
    transform: none;
    transition: none;
  }

  .image {
    display: none;
  }

  /* 2. LÓGICA DE EXIBIÇÃO (A PARTE CORRIGIDA) */

  /* --- PAINÉIS (AS PARTES AZUIS) --- */
  
  /* Por padrão (modo login), esconde o painel da direita */
  .container:not(.sign-up-mode) .right-panel {
    display: none;
  }
  
  /* Quando em modo registro, esconde o painel da esquerda e mostra o da direita */
  .container.sign-up-mode .left-panel {
    display: none;
  }
  .container.sign-up-mode .right-panel {
    display: flex;
  }
  
  /* --- FORMULÁRIOS --- */
  
  /* Por padrão (modo login), mostra o formulário de login e esconde o de registro */
  .container:not(.sign-up-mode) .sign-in-form {
    display: flex;
  }
  .container:not(.sign-up-mode) .sign-up-form {
    display: none;
  }
  
  /* Quando em modo registro, esconde o formulário de login e mostra o de registro */
  .container.sign-up-mode .sign-in-form {
    display: none;
  }
  .container.sign-up-mode .sign-up-form {
    display: flex;
  }


  /* 3. LÓGICA DE ORDEM DOS ELEMENTOS */

  /* Define a ordem: primeiro o painel, depois o formulário */
  .panel { order: 1; }
  .forms-container { order: 2; }
}

@media (max-width: 570px) {
  form {
    padding: 0 1.5rem;
  }
  
  .panel .content {
    padding: 0.5rem 1rem;
  }
  
  .container {
    padding: 1.5rem;
  }
}


/* =================================================================== */
/* ESTILOS DO NOVO DASHBOARD (ESTILO "SUSSY READS")                  */
/* =================================================================== */

:root {
  /* Paleta de Cores */
  --bg-main: #18191A;
  --bg-card: #242526;
  --bg-banner: #3A3B3C;
  --border-color: #3A3B3C;
  --text-primary: #E4E6EB;
  --text-secondary: #B0B3B8;
  --accent-green: #28A745;
  --accent-green-hover: #218838;
}

.app-body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding-top: 60px; /* Espaço para o cabeçalho fixo */
}

/* Cabeçalho Principal */
.main-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: 60px;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
}

.logo {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logout-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.header-logout-btn:hover {
    background-color: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
}

/* Conteúdo Principal */
.dashboard-content {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Banner de Perfil */
.profile-banner {
  background-color: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.banner-image {
  height: 200px;
  background-color: var(--bg-banner);
  border-radius: 8px 8px 0 0;
}

.banner-content {
  display: flex;
  align-items: flex-end;
  padding: 0 2rem 1.5rem 2rem;
  position: relative;
  margin-top: -60px; /* Puxa o conteúdo para cima */
}

#profile-picture {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  background-color: var(--bg-banner);
  object-fit: cover;
}

.profile-details {
  margin-left: 1.5rem;
}

#user-name {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

#user-email {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0 0;
}

.profile-action-btn {
  margin-left: auto; /* Empurra o botão para a direita */
  background-color: var(--bg-banner);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.profile-action-btn:hover {
  background-color: #4E4F50;
}


/* Seção de Estatísticas */
.stats-section {
  margin-top: 2rem;
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.stats-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  background-color: var(--bg-banner);
  padding: 1.5rem;
  border-radius: 6px;
  text-align: center;
}

.stat-card i {
  font-size: 1.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.stat-card .stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Esconde o botão duplicado no mobile */
#logout-button-header {
    display: none;
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        align-items: center;
        margin-top: -80px;
        padding-bottom: 1rem;
    }
    .profile-details {
        margin-left: 0;
        text-align: center;
        margin-top: 1rem;
    }
    .profile-action-btn {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }
    .header-logout-btn {
        display: block; /* Mostra o botão no cabeçalho */
    }
    .profile-action-btn {
        display: none; /* Esconde o botão no perfil */
    }
}

/* =================================================================== */
/* ESTILOS DO MODAL DE EDIÇÃO                                        */
/* =================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.error-text {
    color: #f87171;
    font-size: 0.9rem;
    margin-top: 1rem;
    height: 20px;
}

.modal-footer {
  text-align: right;
  margin-top: 2rem;
}

.save-btn {
  background-color: var(--accent-green);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.save-btn:hover {
  background-color: var(--accent-green-hover);
}