/* =========================================================
   1. RESET E ESTRUTURA GERAL UNIFICADA
   ========================================================= */
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 100px; /* Espaço para o menu inferior do app */
  transition: background-color 0.3s, color 0.3s;
}

/* =========================================================
   2. ESTILOS ANTIGOS (PÁGINA DA MÚSICA E CIFRAS)
   ========================================================= */
header {
  background: linear-gradient(90deg, #6b1d1d, #a83232);
  color: white;
  padding: 18px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
}

.container {
  max-width: 700px;
  margin: auto;
  padding: 20px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.topo h2 {
  margin: 0;
  font-size: 18px;
}

.tom {
  background: #a83232;
  color: white;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.controles {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.controles button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #6b1d1d;
  color: white;
  cursor: pointer;
}

.letra {
  font-size: 18px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.voltar {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #333;
  color: white;
  cursor: pointer;
}

footer {
  text-align: center;
  padding: 15px;
  background: #1f1e1e;
  color: white;
  margin-top: auto;
}

.acoes-admin { 
  margin-top: 10px; 
  display: flex; 
  gap: 10px; 
}
.btn-editar { color: #2b6cb0; font-size: 0.8em; text-decoration: none; font-weight: bold; }
.btn-excluir { color: #e53e3e; font-size: 0.8em; text-decoration: none; font-weight: bold; }
.btn-inativar { color: #718096; font-size: 0.8em; text-decoration: none; font-weight: bold; }

textarea[name="cifra"] {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    overflow-x: auto;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 12px;
    border-radius: 8px;
}

/* =========================================================
   3. 🚀 ESTILOS NOVOS - DASHBOARD, CARDS E MODO ESCURO
   ========================================================= */

/* Animação de Entrada Suave */
@keyframes fadeInApp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeInApp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* 👑 Header Premium */
.header-categoria { background: linear-gradient(135deg, #802323 0%, #a52a2a 100%); padding: 30px 20px 40px 20px; color: #ffffff !important; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; box-shadow: 0 10px 25px rgba(128, 35, 35, 0.2); position: relative; margin-bottom: -15px; text-align: center; z-index: 10;}
.container-header { max-width: 850px; margin: 0 auto; position: relative; }
.btn-header-left { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: white !important; border-radius: 50%; width: 40px; height: 40px; font-size: 1.1em; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); text-decoration: none;}
.btn-header-left:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.05); color: white;}
.btn-header-right { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: white !important; border-radius: 50%; width: 40px; height: 40px; font-size: 1.1em; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.btn-header-right:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.05); }
.header-categoria h1, .header-categoria .titulo-header, .header-categoria .titulo-header i { color: #ffffff !important; }
.titulo-header { margin: 0; font-size: 1.6em; font-weight: 800; letter-spacing: -0.5px; display: inline-flex; align-items: center; gap: 8px; justify-content: center;}

/* Layout Principal e Busca */
.container-principal { max-width: 700px; margin: 0 auto; padding: 40px 20px 30px 20px; box-sizing: border-box; }
.bloco-saudacao { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.texto-saudacao { font-size: 1.15em; color: #475569; font-weight: 500; }
.texto-saudacao strong { color: #0f172a; font-weight: 800; }
.badge-admin-tag { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; text-decoration: none; font-size: 0.75em; padding: 8px 16px; border-radius: 50px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); transition: 0.2s; display: inline-flex; align-items: center; gap: 6px;}
.badge-admin-tag:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4); }

.search-wrapper { position: relative; margin-bottom: 35px; }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.2em; pointer-events: none; }
.campo-busca { width: 100%; padding: 18px 20px 18px 50px; border-radius: 16px; border: 1px solid #cbd5e1; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03); font-size: 1.05em; box-sizing: border-box; outline: none; color: #334155; transition: all 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500; }
.campo-busca:focus { border-color: #802323; box-shadow: 0 0 0 4px rgba(128, 35, 35, 0.1); }

/* Banners (Apresentação e Mural) */
.banner-apresentacao { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); border-radius: 24px; padding: 30px; margin-bottom: 30px; color: white; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); position: relative; overflow: hidden; }
.banner-apresentacao::before { content: ''; position: absolute; top: 0; right: 0; width: 300px; height: 100%; background: radial-gradient(circle, rgba(128,35,35,0.4) 0%, transparent 70%); pointer-events: none; }
.banner-texto h2 { margin: 0 0 10px 0; font-size: 1.5em; font-weight: 800; color: #f8fafc; display: flex; align-items: center; gap: 10px;}
.banner-texto p { margin: 0; color: #94a3b8; line-height: 1.6; font-size: 0.95em; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 2px solid rgba(255,255,255,0.05); }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.btn-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; padding: 14px 28px; border-radius: 50px; text-decoration: none; font-weight: 800; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 10px 25px rgba(220, 39, 67, 0.3); transition: all 0.3s; font-size: 1em; margin-top: 5px; }
.btn-instagram:hover { transform: translateY(-3px) scale(1.02); color: white; box-shadow: 0 15px 35px rgba(220, 39, 67, 0.5); }

.btn-mural { background: #38bdf8; color: #0f172a; text-decoration: none; padding: 12px 24px; border-radius: 12px; font-weight: 800; font-size: 0.95em; transition: 0.2s; white-space: nowrap; box-shadow: 0 4px 15px rgba(56,189,248,0.3); }
.btn-mural:hover { background: #0ea5e9; color: white; transform: translateY(-2px); }

/* Cards de Painel (Rito e Liturgia) */
.card-painel { background: #ffffff; border-radius: 24px; padding: 30px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04); border: 1px solid #f1f5f9; margin-bottom: 30px; transition: all 0.3s; }
.titulo-card { color: #0f172a; font-size: 1.25em; font-weight: 800; margin-top: 0; margin-bottom: 25px; display: flex; align-items: center; justify-content: space-between; transition: color 0.3s; }
.badge-tempo-rito { color: #8b5cf6; font-weight: 800; font-size: 0.75em; margin-left: 8px; background: #f3e8ff; padding: 6px 12px; border-radius: 20px; vertical-align: middle; border: 1px solid #e9d5ff;}
.aviso-liturgico { font-size: 0.85em; color: #475569; margin-bottom: 25px; line-height: 1.6; background: #f8fafc; padding: 15px 18px; border-radius: 12px; border-left: 4px solid #8b5cf6; border-top: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0;}

/* Botões de Categorias (Rito) */
.lista-botoes-rito { display: flex; flex-direction: column; gap: 10px; }
.btn-categoria-item { background-color: #ffffff; color: #1e293b; text-decoration: none; padding: 16px 20px; border-radius: 14px; font-weight: 700; font-size: 1.05em; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.01); }
.btn-categoria-item:hover { border-color: #802323; color: #802323; transform: translateX(5px); box-shadow: 0 6px 15px rgba(128,35,35,0.08); }
.btn-categoria-item.categoria-oculta { opacity: 0.75; border-left: 4px solid #ef4444; background-color: #f8fafc; }
.wrapper-seta { display: flex; align-items: center; gap: 12px; }
.badge-qtd { background: #f8fafc; color: #64748b; font-size: 0.85em; padding: 4px 12px; border-radius: 50px; font-weight: 800; border: 1px solid #e2e8f0; transition: all 0.2s; }
.btn-categoria-item:hover .badge-qtd { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

/* Calendário */
.calendario-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 0 10px; }
.btn-mes { background: #f1f5f9; border: none; border-radius: 10px; width: 36px; height: 36px; font-size: 1.1em; cursor: pointer; color: #802323; font-weight: bold; transition: all 0.2s; display: flex; justify-content: center; align-items: center; }
.btn-mes:hover { background: #fee2e2; }
#mes-ano-display { font-size: 1.1em; font-weight: 800; color: #0f172a; margin: 0; text-transform: capitalize; transition: color 0.3s;}
.calendario-dias-semana { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 700; font-size: 0.8em; color: #94a3b8; margin-bottom: 15px; text-transform: uppercase; }
.calendario-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dia-cal { padding: 10px 0; text-align: center; border-radius: 10px; cursor: pointer; font-size: 0.95em; color: #334155; font-weight: 600; transition: all 0.2s; border: 1px solid transparent; }
.dia-cal:hover:not(.vazio) { background: #fffafa; border-color: #fecaca; color: #802323; }
.dia-cal.hoje { background: #f1f5f9; border-color: #cbd5e1; font-weight: 800; color: #0f172a; }
.dia-cal.selecionado { background: #802323; color: white; font-weight: 800; box-shadow: 0 6px 15px rgba(128,35,35,0.3); border-color: #802323; transform: scale(1.05); }
.dia-cal.vazio { cursor: default; background: transparent; border: none; }

/* Dashboard de Liturgia API */
.dashboard-liturgia { margin-top: 25px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden; display: none; box-shadow: 0 15px 35px rgba(0,0,0,0.05); animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); transition: all 0.3s; }
.dash-header { padding: 25px; color: white; display: flex; justify-content: space-between; align-items: center; background: #10b981; transition: background 0.5s ease; position: relative; overflow: hidden; }
.dash-header::after { content: ''; position: absolute; right: -20px; bottom: -20px; font-size: 8em; opacity: 0.1; font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f518"; }
.dash-data { font-size: 1.3em; font-weight: 800; margin: 0; position: relative; z-index: 2; }
.dash-tempo { font-size: 0.9em; font-weight: 600; opacity: 0.9; margin: 0; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; position: relative; z-index: 2; }
.dash-body { padding: 25px; }
.leitura-box { margin-bottom: 25px; border-left: 3px solid #e2e8f0; padding-left: 18px; position: relative; transition: border-color 0.3s; }
.leitura-titulo { font-size: 0.85em; color: #64748b; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }
.leitura-texto { font-size: 1em; color: #334155; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; transition: color 0.3s; font-weight: 500; }
.leitura-texto.expandido { display: block; -webkit-line-clamp: unset; height: auto; overflow: visible; }
.btn-ler-mais { background: none; border: none; color: #802323; font-size: 0.85em; font-weight: 800; cursor: pointer; padding: 8px 0 0 0; display: inline-block; font-family: 'Plus Jakarta Sans', sans-serif; transition: color 0.3s; }
.btn-ler-mais:hover { text-decoration: underline; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* 🌙 REGRAS DO MODO ESCURO GLOBAIS */
body.dark-mode { background-color: #0f172a; color: #e2e8f0; }
body.dark-mode .header-categoria { background: #1e293b; border-bottom: 1px solid #334155; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
body.dark-mode .card-painel { background-color: #1e293b; border-color: #334155; }
body.dark-mode .titulo-card, body.dark-mode .texto-saudacao strong, body.dark-mode #mes-ano-display { color: #f8fafc; }
body.dark-mode .texto-saudacao { color: #94a3b8; }
body.dark-mode .badge-tempo-rito { background: #3b0764; color: #d8b4fe; border-color: #581c87; }
body.dark-mode .aviso-liturgico { background: #0f172a; color: #cbd5e1; border-left-color: #a855f7; border-top-color: #334155; border-right-color: #334155; border-bottom-color: #334155; }
body.dark-mode .campo-busca { background-color: #0f172a; border-color: #334155; color: #f8fafc; }
body.dark-mode .campo-busca:focus { border-color: #fca5a5; }
body.dark-mode .btn-categoria-item { background-color: #0f172a; border-color: #334155; color: #cbd5e1; }
body.dark-mode .btn-categoria-item:hover { border-color: #fca5a5; color: #fca5a5; background-color: #1e293b; }
body.dark-mode .btn-categoria-item.categoria-oculta { background-color: #1e293b; border-left-color: #ef4444; opacity: 0.6; }
body.dark-mode .badge-qtd { background-color: #1e293b; color: #94a3b8; border-color: #334155; }
body.dark-mode .btn-categoria-item:hover .badge-qtd { background-color: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
body.dark-mode .dia-cal { color: #cbd5e1; }
body.dark-mode .dia-cal.hoje { background-color: #334155; color: #f8fafc; border-color: #475569; }
body.dark-mode .dia-cal:hover:not(.vazio) { background-color: #334155; color: #fca5a5; border-color: #7f1d1d; }
body.dark-mode .btn-mes { background-color: #0f172a; color: #fca5a5; }
body.dark-mode .btn-mes:hover { background-color: #334155; }
body.dark-mode .dashboard-liturgia { background-color: #1e293b; border-color: #334155; }
body.dark-mode .leitura-texto { color: #cbd5e1; }
body.dark-mode .leitura-titulo { color: #64748b; }
body.dark-mode .leitura-box { border-left-color: #334155; }
body.dark-mode .btn-ler-mais { color: #fca5a5; }

/* 📱 RESPONSIVIDADE PARA CELULARES */
@media (max-width: 768px) {
    .header-categoria { padding: 25px 15px 30px 15px; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; margin-bottom: -15px; }
    .titulo-header { font-size: 1.3em; }
    .btn-header-left, .btn-header-right { width: 35px; height: 35px; font-size: 1em; }
}