/* Layout principal responsivo */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-layout {
    display: flex;
    flex-wrap: wrap;
}

.section-title {
    color: #223c50;
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
}

/* Formulário e campos */
.form-section {
    transition: all 0.3s ease;
}

.form-control,
.btn {
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.campo-obrigatorio {
    color: #e74c3c;
    font-weight: bold;
}

.action-buttons {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    display: flex;
    gap: 10px;
}

/* Upload de imagem */
.image-preview-container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e0e0e0; /* borda azul */    
    border-radius: 8px;
    margin-top: 10px;
    padding: 5px;
    transition: all 0.2s;
    overflow: hidden;
}

.image-preview-container .preview-img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 6px;
}

.image-preview-container.drag-over {
    border-color: #C8C538;
    background-color: rgba(200, 197, 56, 0.05);
}

.upload-btn {
    cursor: pointer;
}

/* Editor Quill */
#quillEditor {
    height: 250px;
    margin-bottom: 1rem;
    border-radius: 8px;
}

/* Botões de ação */
.btn-publicar {
    background-color: #C8C538 !important;
    color: #333 !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(200, 197, 56, 0.15);
}

.btn-publicar:hover {
    background-color: #b8b52f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 197, 56, 0.2);
}

.btn-publicar:active {
    animation: bounceBtn 0.45s;
}

/* Lista de posts publicados */
.published-list .sticky-top {
    top: 20px;
    z-index: 100;
}

/* .search-container {
    width: 180px;
}*/

/* Cards de postagem */
#listaPostsAdmin .card {
    padding: 14px 10px 10px 10px;
    border-radius: 13px;
    box-shadow: 0 1px 6px rgba(34, 60, 80, 0.08);
    font-size: 0.97rem;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
    justify-content: space-between;
    transition: all 0.2s;
}

#listaPostsAdmin .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(34, 60, 80, 0.1);
}

#listaPostsAdmin .card-body {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.admin-miniatura-img {
    width: 90px;
    height: 60px;
    border-radius: 7px;
    border: 1px solid #eee;
    object-fit: cover;
    margin-bottom: 7px;
    background: #fafbfc;
    box-shadow: 0 0 2px #e1e1e1;
}

.admin-post-titulo {
    font-weight: 600;
    font-size: 1.06rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.admin-post-categoria {
    font-size: 0.93rem;
    color: #4d7cbb;
    font-weight: 500;
    margin-bottom: 1px;
    text-align: center;
    width: 100%;
    word-break: break-word;
}

.admin-post-data {
    font-size: 0.89rem;
    color: #888;
    text-align: center;
    width: 100%;
    margin-bottom: 3px;
}

.admin-post-acoes {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    margin-top: 7px;
    width: 100%;
}

.admin-post-acoes .btn {
    min-width: 36px;
    min-height: 36px;
    padding: 3px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.09rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.admin-post-acoes .btn:hover {
    transform: scale(1.1);
}


/* Auto-save status */
.auto-save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.auto-save-status.visible {
    display: block;
    opacity: 1;
}

/* Botão Sair destacado */
.btn-sair-admin {
    background: #3F4332;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 10px 32px;
    border-radius: 24px;
    border: none;
    box-shadow: 0 2px 12px rgba(63, 67, 50, 0.08);
    transition: background 0.18s, transform 0.15s;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sair-admin:hover,
.btn-sair-admin:focus {
    background: #C0BD30;
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    text-decoration: none;
}

/* Animação de botão */
@keyframes bounceBtn {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(0.92, 1.08);
    }

    50% {
        transform: scale(1.11, 0.89);
    }

    70% {
        transform: scale(0.95, 1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .admin-layout {
        display: block;
    }

    .form-section,
    .published-list {
        width: 100%;
    }

    .published-list .sticky-top {
        position: relative;
        top: 0;
    }

    .action-buttons {
        flex-direction: column;
    }

    #listaPostsAdmin .col-12 {
        padding-left: 5px;
        padding-right: 5px;
    }
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.post-card {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    transition: transform .2s ease, box-shadow .2s ease;

    &:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    .thumb {
        position: relative;
        height: 0;
        padding-bottom: 56.25%; 
        overflow: hidden;

        img {
            position: absolute;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .actions {
            position: absolute;
            top: .5rem;
            right: .5rem;
            display: flex;
            gap: .25rem;
            opacity: 0;
            transition: opacity .2s;

            button {
                background: rgba(255, 255, 255, 0.9);
                border: none;
                padding: .3rem;
                border-radius: 50%;
                cursor: pointer;
                font-size: .9rem;
            }
        }

        &:hover .actions {
            opacity: 1;
        }
    }

    .info {
        padding: .75rem;

        .title {
            font-size: 1rem;
            margin-bottom: .25rem;
            line-height: 1.2;
            max-height: 2.4em;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .badge.category {
            display: inline-block;
            font-size: .75rem;
            padding: .2rem .5rem;
            border-radius: .25rem;
            background: #C8C538;
            color: #fff;
            margin-bottom: .5rem;
        }

        .date {
            display: block;
            font-size: .75rem;
            color: #666;
        }
    }
}

/* Search field estilizado */
.search-posts {
    max-width: 200px;
    padding: .3rem .75rem;
    border: 1px solid #ccc;
    border-radius: .25rem;
    font-size: .875rem;
    transition: border-color .2s;
}

.search-posts:focus {
    outline: none;
    border-color: #C8C538;
    box-shadow: 0 0 0 2px rgba(200, 197, 56, 0.3);
}

/* Sticky header */
.card.sticky-top {
    top: 1rem;
}

/* Skeleton loader (exemplo simples) */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;

    &::before {
        content: '';
        grid-column: 1 / -1;
        height: 8px;
        background: linear-gradient(90deg, #eee, #ddd, #eee);
        animation: shimmer 1.5s infinite;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Espaçamento extra para os botões da parte inferior */
.admin-actions-bottom {
    padding-bottom: 40px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .admin-actions-bottom {
        padding-bottom: 30px;
        margin-bottom: 20px;
    }
}