/* =================================================================
    ESTILO VISUAL DO PORTAL INMEMORIA
    Tema: Céu Calmo e Boas Lembranças (Versão Completa e Final)
    ================================================================= */

/* 1. Importação das Fontes do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Lora:wght@400;700&display=swap');

/* 2. Variáveis de Cores */
:root {
    --sky-blue-light: #e6f2ff;
    --sky-blue-medium: #b3d9ff;
    
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;

    --warm-gold: #ffc107;
    
    --dark-text: #212529;
    --light-text: #6c757d;

    --white-card-bg: rgba(255, 255, 255, 0.85); 
    --white-card-border: rgba(255, 255, 255, 0.3);
    --danger-red: #e74c3c;
    --pending-bg: rgba(255, 243, 205, 0.9);
    --pending-border: #ffeeba;
}

/* 3. Estilos Globais e Fundo */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark-text);
    background: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?q=80&w=1932&auto=format&fit=crop') center center / cover no-repeat;
    position: relative;
    z-index: 1;
    padding-bottom: 2rem;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* 4. Tipografia */
h1, h2, h3, h4 {
    font-family: 'Lora', serif;
    color: var(--dark-text);
    margin-bottom: 1rem;
    line-height: 1.3;
}
p { margin-bottom: 1rem; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--dark-text); }

/* 5. Layout Principal */
.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white-card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--white-card-border);
}

/* 6. Cabeçalho e Navegação */
header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}
nav {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}
nav .logo { font-family: 'Lora', serif; font-size: 1.8rem; font-weight: bold; }
nav .logo:hover { text-decoration: none; }
nav ul { list-style: none; display: flex; }
nav ul li { margin-left: 25px; }
nav ul li a { font-weight: bold; color: var(--dark-text); }
nav ul li a:hover { color: var(--primary-color); text-decoration: none; }

/* Responsividade para navegação */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    nav ul li {
        margin: 5px 0;
        text-align: center;
    }
}

/* 7. Botões e Formulários */
.btn, button.btn { display: inline-block; background-color: var(--primary-color); color: #fff; padding: 12px 24px; border: none; border-radius: 50px; cursor: pointer; font-weight: bold; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); text-decoration: none; font-size: 1rem; font-family: 'Lato', sans-serif; }
.btn:hover, button.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); text-decoration: none; color: #fff; background-color: var(--primary-color-dark); }
.btn-danger { background-color: var(--danger-red); }
.btn-danger:hover { background-color: #c0392b; }
.btn-secondary { background-color: #f8f9fa; color: var(--dark-text); border: 1px solid #ddd; }
.btn-secondary:hover { background-color: #e2e6ea; color: var(--dark-text); }
.form-container { background: rgba(230, 242, 255, 0.5); padding: 2rem; border-radius: 12px; border: 1px solid var(--white-card-border); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--light-text); }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #dde; border-radius: 8px; background: #fff; transition: all 0.3s ease; font-family: 'Lato', sans-serif; font-size: 1rem; color: var(--dark-text); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); }
.form-group input[type="file"] { padding: 8px; background-color: var(--sky-blue-light); border: 1px dashed var(--sky-blue-medium); }
.form-group input[type="file"]::file-selector-button { margin-right: 15px; border: none; background: var(--primary-color); padding: 8px 12px; border-radius: 4px; color: #fff; cursor: pointer; transition: background .2s ease-in-out; }
.form-group input[type="file"]::file-selector-button:hover { background: var(--primary-color-dark); }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }

/* 8. Estilos de Páginas Específicas */
.memorial-header { text-align: center; padding-bottom: 1rem; margin-bottom: 2rem; }
.memorial-header img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin-bottom: 1.5rem; border: 5px solid var(--white-card-bg); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.lembrancas-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.lembranca-card { display: flex; flex-direction: column; background-color: var(--white-card-bg); border: 1px solid var(--white-card-border); border-radius: 12px; padding: 1.5rem; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
.lembranca-conteudo { display: flex; flex-direction: column; flex-grow: 1; }
.lembranca-conteudo .lembranca-mensagem { flex-grow: 1; }
.lembranca-conteudo .lembranca-autor { font-style: italic; color: var(--light-text); text-align: right; margin-top: auto; }

/* Estilos para as sugestões de memoriais */
.sugestoes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.sugestao-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    border: 1px solid var(--white-card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    color: var(--dark-text);
}
.sugestao-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
}
.sugestao-card .sugestao-imagem {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.sugestao-card .sugestao-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sugestao-card .sugestao-nome {
    font-weight: bold;
}

/* 9. Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.memorial-card { background: var(--white-card-bg); border: 1px solid var(--white-card-border); border-radius: 12px; margin-bottom: 2rem; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
.memorial-card-header { background: rgba(230, 242, 255, 0.7); padding: 1rem 1.5rem; border-bottom: 1px solid var(--white-card-border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.memorial-card-header h3 { margin: 0; font-size: 1.4rem; }
.memorial-card-body { padding: 1.5rem; }
.actions a { margin-left: 10px; }
.share-section { display: none; background: #fdfdfd; padding: 1rem; margin-top: 1rem; border-radius: 5px; border: 1px solid #eee; text-align: center; }
.share-section img { margin-top: 1rem; max-width: 180px; }
.pending-lembranca { border: 1px solid var(--pending-border); background: var(--pending-bg); padding: 1.5rem; border-radius: 12px; margin-bottom: 1rem; }
.pending-lembranca footer { font-size: 0.9em; color: #666; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.moderation-actions a { margin-left: 10px; font-size: 0.9em; }

/* 10. Carrossel de Fotos e Modal de Imagem */
.lembranca-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #e9ecef;
    cursor: grab;
}
.lembranca-slider:active { cursor: grabbing; }
.lembranca-slider .slider-images {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
    pointer-events: none;
}
.lembranca-slider .slider-images img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
    user-select: none;
}
.lembranca-slider .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lembranca-slider:hover .slider-nav { opacity: 1; }
.lembranca-slider .slider-nav a {
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
}
.lembranca-slider .slider-nav a:hover { background-color: rgba(0, 0, 0, 0.8); }

.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 4px; 
    box-sizing: border-box;
}
.image-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.image-modal-content {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    animation: zoomIn 0.3s ease;
}
@keyframes zoomIn { from { transform: scale(0.8); } to { transform: scale(1); } }

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1001;
}
.image-modal-close:hover { color: #bbb; }

/* 11. Design Responsivo */
@media (max-width: 768px) {
    body { 
        background-attachment: scroll;
    }
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1.5rem 1rem;
        border-radius: 0;
    }
    nav { 
        flex-direction: column; 
        gap: 1rem; 
    }
    .lembrancas-container {
        grid-template-columns: 1fr;
    }
    .image-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para Estatísticas do Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 0;
}

.stat-card {
    background: var(--white-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--white-card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card h4 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-card p {
    font-size: 0.9rem;
    color: var(--light-text);
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h4 {
        font-size: 2rem;
    }
}

/* =================================================================
    ESTILOS PARA MENU MÓVEL INFERIOR
    ================================================================= */

/* Header simplificado para mobile */
.mobile-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.mobile-header nav {
    padding: 0 20px;
    justify-content: center;
    height: 100%;
    display: flex;
    align-items: center;
}

.mobile-header .logo {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

/* Container com padding para mobile */
.mobile-container {
    margin-top: 80px;
    margin-bottom: 90px;
    padding: 1rem;
    min-height: calc(100vh - 170px);
}

/* Menu inferior fixo */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex !important;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1001;
    height: 70px;
    overflow: visible !important;
    white-space: nowrap;
    flex-wrap: nowrap;
}

/* Força exibição do menu móvel em telas pequenas via CSS puro */
@media (max-width: 768px) {
    /* Cria o menu móvel via CSS quando não detectado pelo PHP */
    body::after {
        content: '';
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #ffffff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: none;
    }
    
    /* Se não há menu móvel detectado, mostra o fallback */
    body:not(:has(.mobile-bottom-nav))::after {
        display: block;
    }
}

.mobile-bottom-nav .nav-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--light-text);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
    flex: 1;
    max-width: 33.33%;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-bottom-nav .nav-item:hover {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.15);
}

.mobile-bottom-nav .nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.mobile-bottom-nav span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Ajustes responsivos para mobile */
@media (max-width: 480px) {
    .mobile-bottom-nav {
        height: 65px;
        padding: 0.3rem 0;
    }
    
    .mobile-bottom-nav .nav-item {
        min-width: 50px;
        padding: 0.4rem 0.2rem;
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 1.3rem;
    }
    
    .mobile-bottom-nav span {
        font-size: 0.7rem;
    }
    
    .mobile-container {
        padding: 0.5rem;
        margin-bottom: 85px;
    }
}

/* === MENU HAMBÚRGUER MOBILE === */

/* Header mobile com hambúrguer */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 60px;
}

.mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    height: 100%;
}

/* Botão hambúrguer */
.hamburger-menu {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.hamburger-line {
    width: 20px;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 2px;
    margin: 2px 0;
}

.hamburger-menu.active {
    background: rgba(0, 123, 255, 0.2);
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Logo no header mobile */
.mobile-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar mobile */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.active {
    right: 0;
}

/* Header do sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sidebar-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
}

.close-sidebar:hover {
    color: #333;
}

/* Menu do sidebar */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f8f9fa;
    color: #007bff;
}

.sidebar-menu .menu-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Ajuste do conteúdo principal para mobile */
@media (max-width: 768px) {
    body {
        padding-top: 80px;
        padding-bottom: 0;
    }
    
    .container {
        margin-bottom: 0;
        padding: 20px;
    }
}
@media (max-width: 768px) {
    /* Esconde o header desktop em mobile */
    header:not(.mobile-header) {
        display: none !important;
    }
    
    /* Mostra o header mobile */
    .mobile-header {
        display: block !important;
    }
}

/* Estilos removidos - menu hambúrguer implementado */