/* ========== VARIÁVEIS CSS ========== */
:root {
  /* Tema escuro (padrão) */
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-nav: #0f172a;
  --bg-header: #0f172a;
  --bg-input: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --border: #334155;
  --border-focus: #3b82f6;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-tokyo: #c084fc;
  --accent-alert: #f472b6;
  --rating-star: #fbbf24;
  --badge-bg: rgba(59, 130, 246, 0.15);
  --badge-text: #60a5fa;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* Tema claro (ativado pela classe .light) */
body.light {
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-nav: #ffffff;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.3);
  --border: #cbd5e1;
  --text: #1e293b;
  --text-secondary: #64748b;
  --badge-bg: rgba(59, 130, 246, 0.1);
}

/* Modo Glass para tema escuro */
body.glass-mode {
  --bg-card: rgba(30, 41, 59, 0.65) !important;
  --bg-card-hover: rgba(30, 41, 59, 0.85) !important;
  --bg-nav: rgba(15, 23, 42, 0.8) !important;
  --bg-header: rgba(15, 23, 42, 0.9) !important;
  --bg-input: rgba(30, 41, 59, 0.6) !important;
  --bg-overlay: rgba(15, 23, 42, 0.8) !important;
  --border: rgba(255, 255, 255, 0.08) !important;
}

body.light.glass-mode {
  --bg-card: rgba(255, 255, 255, 0.7) !important;
  --bg-card-hover: rgba(255, 255, 255, 0.9) !important;
  --bg-nav: rgba(255, 255, 255, 0.8) !important;
  --bg-header: rgba(255, 255, 255, 0.9) !important;
  --bg-input: rgba(255, 255, 255, 0.7) !important;
  --bg-overlay: rgba(0, 0, 0, 0.3) !important;
  --border: rgba(0, 0, 0, 0.08) !important;
}

/* Efeitos glass */
body.glass-mode header,
body.glass-mode .bottom-nav,
body.glass-mode .drawer,
body.glass-mode .card,
body.glass-mode .list-item,
body.glass-mode .stat-card,
body.glass-mode .profile-card,
body.glass-mode .pix-modal-box {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ========== RESET ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
  padding-bottom: 80px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

main {
  flex: 1;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== HEADER (unificado) ========== */
header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  transition: background-color var(--transition);
}

header .logo {
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
header .logo span {
  color: var(--accent-tokyo);
}

header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  margin-left: 2rem;
}

header nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition);
}
header nav a:hover,
header nav a.active {
  color: var(--accent);
}

/* ========== PERFIL E BOTÕES ========== */
#sound-toggle {
  margin-left: auto;
}

.theme-toggle {
  font-size: 1.4rem;
  margin-left: 0.3rem;
}

#profile-container {
  order: 1;
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: var(--bg-card);
}
.footer a {
  color: var(--accent);
}

/* ========== CARDS DE MANGÁ ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.card-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background-color: #1e293b;
}

.card-body {
  padding: 0.75rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ========== RATING / ESTRELAS ========== */
.rating {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--rating-star);
  font-weight: 600;
  font-size: 0.8rem;
}
.rating .star {
  font-size: 0.9rem;
}

/* ========== BOTÕES ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  transition: background var(--transition), transform 0.1s;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-hover);
}

/* ========== DRAWER (BARRA LATERAL) ========== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 110;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drawer.open {
  left: 0;
}

.drawer-handle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 80;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 0.4rem;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition);
}
.drawer-handle:hover {
  background: var(--bg-card-hover);
}

.drawer h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.drawer a,
.drawer button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.drawer a:hover,
.drawer button:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ========== BARRA DE NAVEGAÇÃO INFERIOR ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0;
  z-index: 90;
  transition: background var(--transition);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.bottom-nav a i {
  font-size: 1.3rem;
}
.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
}

/* ========== SEÇÕES DA HOME ========== */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner {
  background: linear-gradient(135deg, var(--accent-tokyo), var(--accent));
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1.5rem 0;
  color: #fff;
  box-shadow: var(--shadow);
}
.banner h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.banner p {
  opacity: 0.9;
  margin-bottom: 1rem;
}
.banner .btn {
  background: #fff;
  color: var(--accent);
}
.banner .btn:hover {
  background: #e2e8f0;
}

/* ========== MENSAGENS DE STATUS ========== */
.loading,
.error,
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}
.error {
  color: var(--accent-alert);
}

/* ========== MODAL PIX ========== */
.pix-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.pix-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-hover);
  color: var(--text);
}
.pix-modal-box h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.pix-modal-box input {
  width: 100%;
  padding: 0.6rem;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
}
.pix-modal-box input:focus {
  border-color: var(--accent);
}
.pix-modal-box button {
  margin: 0.4rem 0.2rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  transition: background var(--transition);
}
.pix-modal-box button:hover {
  background: var(--accent-hover);
}
.pix-modal-box .btn-fechar {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  border: none;
}
.pix-msg {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* ========== INPUTS E FILTROS ========== */
.search-input,
input[type="text"],
input[type="number"],
select {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}
.search-input:focus,
select:focus {
  border-color: var(--accent);
}

/* ========== LIST ITEMS ========== */
.list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: background var(--transition);
  cursor: pointer;
}
.list-item:hover {
  background: var(--bg-card-hover);
}
.list-item-img {
  width: 50px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #1e293b;
}
.list-item-info {
  flex: 1;
}
.list-item-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.list-item-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== PERFIL ========== */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  object-fit: cover;
  margin: 0 auto 1rem;
}
.profile-name-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.profile-email-large {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.profile-badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.mini-gallery {
  margin-bottom: 1.5rem;
}
.mini-gallery h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.mini-gallery-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.mini-gallery-item {
  flex: 0 0 80px;
  text-align: center;
  cursor: pointer;
}
.mini-gallery-item img {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  background-color: #1e293b;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.mini-gallery-item img:hover {
  transform: scale(1.05);
}
.mini-gallery-item .mini-title {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== LEITOR ========== */
body.reader-mode {
  background-color: #0a0a0f;
  padding-bottom: 0;
}
body.light.reader-mode {
  background-color: #f5f0e8;
}

.reader-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reader-nav-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.reader-nav-group .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.reader-nav-group .logo span {
  color: var(--accent-tokyo);
}
.chapter-info {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.reader-controls-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-chapter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-chapter:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}
.btn-chapter:disabled {
  opacity: 0.4;
  cursor: default;
}

.reader-controls-group select {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .reader-header {
    flex-direction: column;
    align-items: stretch;
  }
  .reader-nav-group,
  .reader-controls-group {
    justify-content: center;
    gap: 0.4rem;
  }
  .btn-chapter {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
}

/* ========== DROPDOWN PERFIL ========== */
.profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  transition: background var(--transition);
}
.profile-icon:hover {
  background: var(--bg-card-hover);
}
.profile-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 200px;
  padding: 0.5rem 0;
  box-shadow: var(--shadow-hover);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}
.dropdown-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
  background: none;
  border: none;
}
.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0;
}

/* ========== LISTA DE CAPÍTULOS ========== */
.chapter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  transition: background var(--transition);
  gap: 1rem;
  flex-wrap: wrap;
}
.chapter-item:first-of-type {
  border-top: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.chapter-item:last-of-type {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.chapter-item:hover {
  background: var(--bg-card-hover);
}

.chapter-number {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chapter-meta .btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  white-space: nowrap;
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
  }
  .card-body {
    padding: 0.5rem;
  }
  .card-title {
    font-size: 0.78rem;
  }
  header {
    padding: 0.5rem 1rem;
  }
  .drawer {
    width: 260px;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
  }
}

/* Estilo específico do reader (continuação) */
#chapter-select {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 130px;
}

.btn-chapter {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.chapter-info {
  line-height: 1.4;
}

.reader-header {
  padding: 0.8rem 1.2rem;
}

@media (max-width: 600px) {
  .reader-header {
    padding: 0.6rem 0.8rem;
    gap: 0.5rem;
  }
  #chapter-select {
    max-width: 110px;
    font-size: 0.75rem;
  }
  .btn-chapter {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
}

/* Remove outline azul padrão */
*:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========== ANIMAÇÕES ========== */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: cardSlideIn 0.5s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.40s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }

.drawer {
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay {
  transition: opacity 0.35s ease;
}

/* Remove completamente o highlight azul ao tocar em qualquer elemento */
* {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

/* Remove também qualquer sombra de foco em inputs, botões e links */
input:focus,
button:focus,
a:focus,
select:focus,
textarea:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Badge "Novo" posicionado absolutamente no canto superior direito da capa */
.card-cover-wrapper {
  position: relative;
}

.card-new-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #f97316;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ========== ANIMAÇÕES DA MANUTENÇÃO ========== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}
/* Botões de ação maiores e mais espaçados (favoritos e listas) */
.btn-remove-fav,
.btn-add-to-list,
.btn-toggle-list,
.btn-delete-list,
.btn-remove-from-list {
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  margin-left: 0.4rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-remove-fav:hover,
.btn-delete-list:hover,
.btn-remove-from-list:hover {
  background: rgba(244, 114, 182, 0.15);
}
.btn-add-to-list:hover {
  background: rgba(59, 130, 246, 0.15);
}
.btn-toggle-list:hover {
  background: var(--bg-card-hover);
}
/* ========== BOTÃO "ADICIONAR À LISTA" NA PÁGINA DE DETALHES ========== */
#add-to-list-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: all var(--transition);
}
#add-to-list-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ========== DROPDOWN DE LISTAS (PÁGINA DE DETALHES) ========== */
#dropdown-listas {
  min-width: 200px;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 0.5rem 0;
  z-index: 250;
  overflow: hidden;
}

#dropdown-listas .dropdown-item {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
}
#dropdown-listas .dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}
.config-btn:active {
  transform: scale(0.98);
  filter: brightness(0.9);
}
#profile-container {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;                /* Alinha o canto direito do dropdown com o canto direito do container */
  left: auto;              /* Remove o centralizamento anterior */
  min-width: 220px;
  width: max-content;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform-origin: top right; /* A animação parte do canto superior direito */
  transform: translateY(-10px);
}

.dropdown-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Ícone do perfil (mantém o círculo) */
.profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}

/* Ajuste para os itens do dropdown */
.dropdown-item {
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

/* Em telas muito pequenas, permite que o texto quebre */
@media (max-width: 480px) {
  .dropdown-menu {
    min-width: 200px;
    max-width: 260px;
  }
  .dropdown-item {
    white-space: normal;
    word-break: break-word;
  }
}
/* ========== PERFIL - BOTÕES E ORGANIZAÇÃO ========== */

/* Container dos botões principais (Favoritos, Histórico) */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0 1rem;
}

.profile-actions .btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
  justify-content: center;
}

/* Botão de notificações (ocupa toda largura, mas com bom espaçamento) */
#btn-notificacoes {
  width: 100%;
  margin: 0.5rem 0 1.5rem;
  padding: 0.75rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  transition: background 0.2s;
}

#btn-notificacoes:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Área de conquistas (medalhas) */
#emblemas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  margin: 1rem 0;
}

.mini-gallery-item {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  transition: transform 0.2s, background 0.2s;
  cursor: default;
}

.mini-gallery-item:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

.mini-gallery-item i {
  font-size: 2rem;
  color: #fbbf24;
}

.mini-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.3rem 0;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
}

/* Ajuste para a mensagem "Nenhuma conquista" */
.profile-card + p {
  text-align: center;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Melhorias nos cards de estatísticas (já existentes, mas garantindo alinhamento) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  text-align: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Responsivo: em telas pequenas, botões ocupam largura total */
@media (max-width: 480px) {
  .profile-actions .btn {
    min-width: 100%;
  }
  
  .mini-gallery-item {
    width: 80px;
  }
}