/*
Theme Name: Associação dos Bairros - Mínimo
Description: Versão simplificada e estável do tema para WordPress
Version: 1.0.0
Author: Desenvolvimento
*/

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.site-header {
    background: #d32f2f;
    color: white;
    padding: 20px 0;
}

.site-title {
    font-size: 2rem;
    text-align: center;
}

.site-title a {
    color: white;
    text-decoration: none;
}

/* Layout principal */
.main-content {
    padding: 30px 0;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
}

.column-title {
    color: #d32f2f;
    border-bottom: 2px solid #d32f2f;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Posts */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-title {
    color: #333;
    margin-bottom: 10px;
}

.post-description {
    color: #666;
    margin: 10px 0 15px 0;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.post-category {
    background: #2196f3;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.post-date {
    color: #999;
    font-size: 14px;
}

/* Instagram - VERSÃO APRIMORADA PARA EMBEDS NATIVOS */
.instagram-embed {
    margin: 15px 0;
    text-align: center;
}

.instagram-embed-container {
    margin: 15px 0 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.instagram-media {
    max-width: 100% !important;
    min-width: 280px !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
}

/* Garantir que vídeos do Instagram apareçam */
.instagram-media iframe {
    width: 100% !important;
    min-height: 400px !important;
    border: none !important;
    border-radius: 8px !important;
}

/* Loading state para embeds */
.instagram-media:empty {
    min-height: 300px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-media:empty::before {
    content: "Carregando embed do Instagram...";
    color: #6c757d;
    font-style: italic;
}

.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e4405f;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}

.instagram-link:hover {
    background: #d32f2f;
}

/* Responsividade do Instagram */
@media (max-width: 768px) {
    .instagram-embed-container {
        margin: 10px -5px;
    }
    
    .instagram-media {
        min-width: 250px !important;
        max-width: 95% !important;
    }
    
    .instagram-media iframe {
        min-height: 350px !important;
    }
}

@media (max-width: 480px) {
    .instagram-embed-container {
        margin: 10px -10px;
    }
    
    .instagram-media {
        min-width: 220px !important;
        max-width: 100% !important;
    }
    
    .instagram-media iframe {
        min-height: 300px !important;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* CSS Admin - Interface melhorada */
.wrap {
    margin: 10px 20px 0 2px;
}

.wrap h1 {
    color: #23282d;
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 20px;
    padding: 9px 0 4px;
    line-height: 1.3;
}

.wrap h2 {
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 15px;
    padding: 0;
}

/* Formulários admin */
.admin-form {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.admin-form h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1d2327;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Botões admin */
.btn {
    background: #2271b1;
    border: 1px solid #2271b1;
    color: #fff;
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
    transform: translateY(-1px);
}

/* Botões de ação - Exclusão */
.delete-post, .delete-banner {
    background: #d63638 !important;
    border-color: #d63638 !important;
    color: white !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 3px !important;
    transition: all 0.2s ease;
    font-weight: 500;
}

.delete-post:hover, .delete-banner:hover {
    background: #b32d2e !important;
    border-color: #b32d2e !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(214, 54, 56, 0.3);
}

/* Tabelas admin */
.wp-list-table {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.wp-list-table th {
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    color: #50575e;
    font-weight: 600;
    padding: 12px 10px;
}

.wp-list-table td {
    border-bottom: 1px solid #f0f0f1;
    padding: 12px 10px;
    vertical-align: top;
}

.wp-list-table tr:hover {
    background-color: #f6f7f7;
}

.wp-list-table img {
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Alertas e mensagens */
.notice {
    margin: 5px 0 15px;
    padding: 1px 12px;
    border-left: 4px solid;
    border-radius: 0 3px 3px 0;
}

.notice-success {
    border-left-color: #00a32a;
    background-color: #f0f6fc;
}

.notice-error {
    border-left-color: #d63638;
    background-color: #fcf2f2;
}

/* Responsividade admin */
@media screen and (max-width: 782px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        max-width: 100%;
    }
    
    .wp-list-table {
        font-size: 12px;
    }
    
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 6px;
    }
    
    .admin-form {
        margin: 10px 5px;
        padding: 15px;
    }
}

/* Responsividade banners */
@media screen and (max-width: 768px) {
    .banner-top,
    .banner-center {
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .banner-text {
        padding: 15px 10px;
        font-size: 14px;
        max-width: 100%;
        margin: 0 10px;
    }
    
    .banner-image {
        max-width: calc(100% - 20px);
        margin: 0 auto;
    }
    
    .banner-html {
        margin: 0 10px;
    }
}

@media screen and (max-width: 480px) {
    .banner-area {
        min-height: 60px;
        margin: 15px 5px;
    }
    
    .banner-top,
    .banner-center {
        margin: 15px 5px;
        max-width: calc(100% - 10px);
    }
    
    .banner-text {
        font-size: 13px;
        padding: 12px 8px;
        min-height: 50px;
    }
}

/* ========================================
   SISTEMA LGPD
   ======================================== */

/* Banner LGPD */
.lgpd-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    display: none;
}

.lgpd-banner.show {
    display: block;
    transform: translateY(0);
}

.lgpd-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.lgpd-icon {
    font-size: 24px;
    color: #ffd700;
    flex-shrink: 0;
}

.lgpd-text {
    flex: 1;
    min-width: 250px;
}

.lgpd-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.lgpd-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
}

.lgpd-text a {
    color: #ffd700;
    text-decoration: underline;
}

.lgpd-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.lgpd-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lgpd-btn-accept {
    background: #28a745;
    color: white;
}

.lgpd-btn-accept:hover {
    background: #218838;
    transform: translateY(-2px);
}

.lgpd-btn-customize {
    background: #6c757d;
    color: white;
}

.lgpd-btn-customize:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.lgpd-btn-reject {
    background: #dc3545;
    color: white;
}

.lgpd-btn-reject:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Modal LGPD */
.lgpd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lgpd-modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.lgpd-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lgpd-modal.show .lgpd-modal-content {
    transform: scale(1);
}

.lgpd-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border-radius: 12px 12px 0 0;
}

.lgpd-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lgpd-modal-body {
    padding: 30px;
}

.lgpd-category {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.lgpd-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lgpd-category h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.lgpd-category p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.lgpd-toggle {
    position: relative;
    display: inline-block;
}

.lgpd-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lgpd-toggle-label {
    display: block;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

.lgpd-toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lgpd-toggle input:checked + .lgpd-toggle-label {
    background: #28a745;
}

.lgpd-toggle input:checked + .lgpd-toggle-label .lgpd-toggle-switch {
    transform: translateX(24px);
}

.lgpd-toggle input:disabled + .lgpd-toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.lgpd-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Responsividade LGPD */
@media screen and (max-width: 768px) {
    .lgpd-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .lgpd-actions {
        width: 100%;
        justify-content: center;
    }
    
    .lgpd-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    
    .lgpd-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .lgpd-modal-header,
    .lgpd-modal-body,
    .lgpd-modal-footer {
        padding: 20px;
    }
    
    .lgpd-modal-footer {
        flex-direction: column;
    }
    
    .lgpd-modal-footer .lgpd-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Banners */
.banner-area {
    margin: 20px 0;
    min-height: 90px;
    background: #f8d7da;
    border: 2px dashed #d32f2f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #721c24;
    font-style: italic;
    position: relative;
    overflow: hidden;
}

.banner-area:empty::before {
    content: "Espaço para Banner";
    opacity: 0.7;
}

.banner-top {
    margin: 0 auto 20px auto;
    min-height: 90px;
    max-width: 1200px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-bottom {
    margin-bottom: 0;
    min-height: 90px;
}

.banner-center {
    min-height: 60px;
    margin: 30px auto;
    max-width: 1200px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-sidebar {
    min-height: 200px;
    margin: 15px 0;
    width: 100%;
}

/* Banner com conteúdo */
.banner-area.has-content {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.banner-area.has-content::before {
    display: none;
}

/* Tipos de banner */
.banner-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    
    /* Garantir que GIFs animados funcionem corretamente */
    image-rendering: auto;
    -webkit-image-rendering: auto;
    -moz-image-rendering: auto;
    
    /* Evitar compressão que pode quebrar animações */
    object-fit: contain;
    
    /* Transição suave para hover em imagens estáticas */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* GIFs específicos - manter animação sempre ativa */
.banner-image[src*=".gif"] {
    /* Forçar que GIFs não sejam otimizados pelo browser */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    
    /* Animação contínua para GIFs */
    animation-play-state: running !important;
}

.banner-image[src*=".gif"]:hover {
    /* Hover mais sutil para GIFs para não interferir na animação */
    transform: scale(1.01);
}

.banner-text {
    text-align: center;
    padding: 20px 15px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    border-radius: 8px;
    font-weight: bold;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    max-width: 800px;
    margin: 0 auto;
}

.banner-html {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Links de banner */
.banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.banner-link:hover {
    opacity: 0.8;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Responsivo */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    .banner-sidebar {
        min-height: 100px;
    }
    
    .banner-area {
        margin: 10px 0;
    }
}

/* Admin básico */
.admin-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn {
    background: #d32f2f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn:hover {
    background: #b71c1c;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}
