/* MAANAIM - Design do Mockup Verde/Dourado */
:root {
    --verde-principal: #2d5a3a;
    --verde-claro: #4a8a5f;
    --verde-superclaro: #e8f5e8;
    --dourado: #f4c430;
    --dourado-escuro: #d4a017;
    --branco-creme: #f9f9f5;
    --cinza-escuro: #2c3e50;
    --sombra: 0 10px 30px rgba(45, 90, 58, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    color: var(--cinza-escuro);
    line-height: 1.6;
}

/* HEADER MODERNO (como no mockup) */
.header {
    background: linear-gradient(135deg, #166534 0%, #166534 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--sombra);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="rgba(255,255,255,0.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="20" cy="20" r="20" fill="url(%23a)"/><circle cx="80" cy="80" r="15" fill="url(%23a)"/></svg>');
    opacity: 0.3;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 0.2rem;
}

.header-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* NAVEGAÇÃO HORIZONTAL */
.nav {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav a:hover {
    background: var(--dourado);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244,196,48,0.4);
}

/* SEÇÕES COM FOTOS (como no mockup) */
.section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.hero {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: var(--sombra);
    margin-bottom: 4rem;
}

.hero h2 {
    font-size: 2rem;
    color: var(--verde-principal);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p,
.hero .hero-content,
#heroSubtitle {
    font-size: 1.1rem;
    color: var(--cinza-escuro);
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* Hero com conteúdo avançado - permitir float e positioning */
#heroSubtitle {
    text-align: center;
}

#heroSubtitle * {
    max-width: 100%;
}

/* Limitar apenas imagens que podem quebrar o layout */
#heroSubtitle > img {
    max-width: 100% !important;
    height: auto !important;
}

/* Todos os campos de conteúdo - permitir estilos avançados */
#sobreContent,
.conteudo-texto,
#ministerios-content,
#mensagem-content {
    overflow: visible;
}

/* Permitir imagens posicionadas no hero */
.hero .hero-content img[data-position="left"],
.hero .hero-content img[data-position="right"] {
    max-width: 45%;
    width: 45%;
}

/* SEÇÃO SOBRE NÓS COM FOTO */
.sobre {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--sombra);
}

.sobre-texto h3 {
    font-size: 1.8rem;
    color: var(--verde-principal);
    margin-bottom: 1rem;
}

.sobre-texto {
    max-width: 500px;
}

.sobre-foto {
    text-align: center;
}

.sobre-foto img {
    width: 80% !important;
    max-width: 250px !important;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* MINISTÉRIOS (grid 4x1 como mockup) */
.ministerios {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--sombra);
    text-align: center;
}

.ministerios h3 {
    font-size: 2rem;
    color: var(--verde-principal);
    margin-bottom: 2.5rem;
}

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

.ministerio {
    padding: 1.5rem;
    border-radius: 15px;
    background: var(--verde-superclaro);
    transition: all 0.3s ease;
}

.ministerio:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(45,90,58,0.3);
}

.ministerio-icone {
    font-size: 3rem;
    color: var(--dourado);
    margin-bottom: 1rem;
}

.ministerio h4 {
    font-size: 1.2rem;
    color: var(--verde-principal);
    margin-bottom: 0.5rem;
}

/* EVENTOS E MENSAGENS (lado a lado) */
.eventos-mensagens {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 4rem;
}

.evento-card, .mensagens-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--sombra);
    text-align: center;
}

.evento-card h4, .mensagens-card h4 {
    font-size: 1.5rem;
    color: var(--verde-principal);
    margin-bottom: 1.5rem;
    position: relative;
}

.evento-card h4::before, .mensagens-card h4::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--dourado);
    border-radius: 2px;
}

/* NOTÍCIAS */
.noticias {
    text-align: center;
}

.noticias h3 {
    font-size: 2rem;
    color: var(--verde-principal);
    margin-bottom: 2rem;
    position: relative;
}

.noticias h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--dourado);
    border-radius: 2px;
}

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.noticia-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--sombra);
    transition: transform 0.3s ease;
}

.noticia-card:hover {
    transform: translateY(-5px);
}

.noticia-card h4 {
    color: var(--verde-principal);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.noticia-card p {
    color: var(--cinza-escuro);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.noticia-data {
    color: var(--verde-claro);
    font-size: 0.9rem;
    font-style: italic;
}

/* FORMULÁRIOS (login/registro) */
.form-section {
    max-width: 500px;
    margin: 4rem auto;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--sombra);
}

.form-section h2 {
    text-align: center;
    color: var(--verde-principal);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.form-section input {
    width: 100%;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-section input:focus {
    outline: none;
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 3px rgba(45,90,58,0.1);
}

.form-section button {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--verde-principal), var(--verde-claro));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(45,90,58,0.4);
}

/* RODAPÉ */
.footer {
    background: var(--verde-principal);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 5rem;
}

/* RESPONSIVO */
@media (max-width: 768px) {
    /* Header */
    .header h1 { font-size: 2.2rem; }
    .header { padding: 1rem; }
    
    /* Navegação - empilhar verticalmente */
    .nav { 
        flex-direction: column; 
        gap: 0.5rem;
        margin-top: 1rem;
    }
    .nav a {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Seções gerais */
    .section {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    /* Sobre nós - coluna única */
    .sobre { 
        grid-template-columns: 1fr; 
        text-align: center;
        padding: 1.5rem;
        gap: 2rem;
    }
    
    /* Eventos e mensagens - coluna única */
    .eventos-mensagens { 
        grid-template-columns: 1fr; 
        gap: 2rem;
    }
    
    /* Grid de Ministérios - responsivo */
    .grid-ministerios {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    /* Notícias - grid responsivo */
    .noticias-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hero */
    .hero {
        padding: 1.5rem 1rem;
    }
    .hero h2 {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem;
        font-size: 0.85rem;
    }
    
    /* Bíblia - seletor flexível */
    .biblia-selector {
        flex-direction: column;
    }
    .biblia-selector select {
        width: 100%;
    }
    
    /* Bíblia - busca flexível */
    .biblia-search {
        flex-direction: column;
    }
    .biblia-search input,
    .biblia-search button {
        width: 100%;
    }
    
    /* Bíblia - tabs */
    .biblia-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    .biblia-tab {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }
    
    /* Bíblia - navegação */
    .biblia-nav {
        flex-direction: column;
        gap: 1rem;
    }
    .biblia-nav button {
        width: 100%;
    }
    
    /* Conteúdo bíblico - leitura */
    .biblia-content {
        font-size: 1rem;
    }
    
    /* Login/Register forms */
    .login-container,
    .register-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .login-container h1,
    .register-container h1 {
        font-size: 1.8rem;
    }
    
    .form-group input,
    .form-group button {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    /* Programaçao */
    .programacao-grid {
        grid-template-columns: 1fr;
    }
    
    /* Membro area */
    .membro-grid {
        grid-template-columns: 1fr;
    }
    
    /* Aulas */
    .aulas-grid {
        grid-template-columns: 1fr;
    }
    
    /* Galeria */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Responsividade para telas muito pequenas */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .grid-ministerios {
        grid-template-columns: 1fr;
    }
    
    .ministerio {
        padding: 1rem;
    }
    
    .footer {
        font-size: 0.75rem;
    }
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 120px);
}

.admin-sidebar {
    width: 280px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--sombra);
    padding: 2rem 0;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    padding: 0 1.5rem 1rem;
    color: var(--verde-principal);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-section a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--cinza-escuro);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-section a:hover,
.sidebar-section a.active {
    background: var(--verde-superclaro);
    color: var(--verde-principal);
}

.logout-btn {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    color: #ff6b6b !important;
}

.admin-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--sombra);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--verde-principal);
    margin-bottom: 0.5rem;
}

.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--sombra);
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: var(--verde-superclaro);
    font-weight: 600;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.btn-edit { background: var(--dourado); color: white; }
.btn-delete { background: #ff6b6b; color: white; }

/* HEADER ADMIN - VERMELHO */
body.admin-mode .header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4) !important;
}

body.admin-mode .header h1 {
    color: #fff !important;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5) !important;
}

body.admin-mode .nav a {
    background: rgba(255,255,255,0.25) !important;
}

body.admin-mode .nav a:hover {
    background: #ffd700 !important; /* Dourado no hover */
    color: #333 !important;
}

/* ========== SKELETON LOADING ========== */
.skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 10px;
    height: 150px;
    width: 100%;
}

.skeleton-card.sm {
    height: 80px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dark mode skeleton */
@media (prefers-color-scheme: dark) {
    .skeleton-card {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* ========== IMAGENS NO CONTEÚDO ========== */
.conteudo-texto,
.noticia-conteudo,
.content-positioned,
#heroSubtitle,
.hero-content,
.sobre-texto,
.mensagens-card {
    position: relative;
}

/* Conteúdo do editor - permitir estilos avançados */
#sobreContent,
.conteudo-texto,
.hero-content,
.mensagem-content,
.noticia-conteudo,
.sobre-texto {
    overflow: visible !important;
    max-width: 100% !important;
}

/* Garantir que estilos inline funcionem */
#sobreContent *,
.conteudo-texto *,
.hero-content *,
.mensagem-content *,
.noticia-conteudo *,
.sobre-texto * {
    max-width: 100% !important;
}

/* Imagens com data-position do editor */
.conteudo-texto img[data-position="left"],
#heroSubtitle img[data-position="left"],
.hero-content img[data-position="left"],
.noticia-conteudo img[data-position="left"],
.hero .hero-content img[data-position="left"],
.sobre-texto img[data-position="left"],
#sobreContent img[data-position="left"] {
    float: left !important;
    margin-right: 1rem !important;
    margin-bottom: 0.5rem !important;
    max-width: 45% !important;
    width: auto !important;
}

.conteudo-texto img[data-position="right"],
#heroSubtitle img[data-position="right"],
.hero-content img[data-position="right"],
.noticia-conteudo img[data-position="right"],
.hero .hero-content img[data-position="right"],
.sobre-texto img[data-position="right"],
#sobreContent img[data-position="right"] {
    float: right !important;
    margin-left: 1rem !important;
    margin-bottom: 0.5rem !important;
    max-width: 45% !important;
    width: auto !important;
}

.conteudo-texto img[data-position="center"],
#heroSubtitle img[data-position="center"],
.hero-content img[data-position="center"],
.noticia-conteudo img[data-position="center"],
.hero .hero-content img[data-position="center"],
.sobre-texto img[data-position="center"],
#sobreContent img[data-position="center"] {
    display: block !important;
    margin: 1rem auto !important;
    max-width: 80% !important;
    width: auto !important;
    float: none !important;
}

/* Tamanho das imagens (data-size) */
.conteudo-texto img[data-size="30%"],
#heroSubtitle img[data-size="30%"],
.hero-content img[data-size="30%"],
.noticia-conteudo img[data-size="30%"],
.hero .hero-content img[data-size="30%"],
.sobre-texto img[data-size="30%"],
#sobreContent img[data-size="30%"] {
    width: 30% !important;
    max-width: 30% !important;
}

.conteudo-texto img[data-size="50%"],
#heroSubtitle img[data-size="50%"],
.hero-content img[data-size="50%"],
.noticia-conteudo img[data-size="50%"],
.hero .hero-content img[data-size="50%"],
.sobre-texto img[data-size="50%"],
#sobreContent img[data-size="50%"] {
    width: 50% !important;
    max-width: 50% !important;
}

.conteudo-texto img[data-size="80%"],
#heroSubtitle img[data-size="80%"],
.hero-content img[data-size="80%"],
.noticia-conteudo img[data-size="80%"],
.hero .hero-content img[data-size="80%"],
.sobre-texto img[data-size="80%"],
#sobreContent img[data-size="80%"] {
    width: 80% !important;
    max-width: 80% !important;
}

/* Limpar floats */
.conteudo-texto::after,
#heroSubtitle::after,
.hero-content::after,
.noticia-conteudo::after,
.sobre-texto::after,
.mensagens-card::after {
    content: "";
    display: table;
    clear: both;
}

.conteudo-texto img,
#heroSubtitle img,
.hero-content img,
.noticia-conteudo img,
.content-image,
.conteudo-section img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

.content-image-center {
    display: block;
    margin: 1rem auto;
    max-width: 100%;
}

.content-image-left {
    float: left;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}

.content-image-right {
    float: right;
    margin-left: 1rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}

.content-image-left::after,
.content-image-right::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsividade para imagens em telas menores */
@media (max-width: 768px) {
    .content-image-center {
        max-width: 100%;
    }
    
    .content-image-left,
    .content-image-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* Limpar floats após conteúdo com imagens */
.sobre-texto::after,
.mensagens-card::after,
.noticia-conteudo::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsividade para imagens em telas menores */
@media (max-width: 768px) {
    .content-image-center {
        max-width: 100%;
    }
    
    .content-image-left,
    .content-image-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* Estilo para conteúdo de notícias e textos em geral */
.noticia-card .noticia-conteudo,
.conteudo-texto {
    margin: 1rem 0;
    line-height: 1.6;
    overflow: hidden; /* Prevenir collapse com floats */
}

.noticia-card .noticia-conteudo p {
    margin-bottom: 0.5rem;
}

