/* ============================================
   MURAL DE MENSAGENS - HYBRID LAYOUT (V3)
   ============================================ */

/* Theme Color Variables */
:root,
.theme-rosa {
    --mb-primary: #dc8cdb;
    --mb-primary-light: #e9a7e8;
    --mb-primary-shadow: rgba(220, 140, 219, 0.4);
}

.theme-azul {
    --mb-primary: #3F51B5;
    --mb-primary-light: #303F9F;
    --mb-primary-shadow: rgba(63, 81, 181, 0.4);
}

.theme-verde {
    --mb-primary: #2E7D32;
    --mb-primary-light: #1B5E20;
    --mb-primary-shadow: rgba(46, 125, 50, 0.4);
}

.theme-amarelo {
    --mb-primary: #F59E0B;
    --mb-primary-light: #D97706;
    --mb-primary-shadow: rgba(245, 158, 11, 0.4);
}

.theme-castanho {
    --mb-primary: #795548;
    --mb-primary-light: #5D4037;
    --mb-primary-shadow: rgba(121, 85, 72, 0.4);
}

.message-board-section {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 20px 0;
}

.message-board-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Header */
.mb-header {
    text-align: center;
    margin-bottom: 24px;
}

.mb-title {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mb-title i {
    animation: float 3s ease-in-out infinite;
    /* Gradient também no ícone via JS ou CSS trick, mas text-fill-color funciona se o ícone for fonte */
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.mb-subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 16px;
}

.mb-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.mb-counter .current {
    color: var(--mb-primary);
    font-weight: 800;
    font-size: 18px;
}

/* Empty State Icon */
.mb-empty-icon {
    font-size: 48px;
    color: var(--mb-primary);
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ============================================
   MASONRY GRID (Desktop)
   ============================================ */

.mb-masonry {
    column-count: 3;
    column-gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 992px) {
    .mb-masonry {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .mb-masonry {
        display: none;
    }
}

.mb-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.5s ease-out;
    display: inline-block;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mb-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--mb-primary);
}

.mb-card::before {
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 32px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

/* Card Colors - Based on data-color attribute */
.mb-card[data-color="yellow"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}

.mb-card[data-color="blue"] {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}

.mb-card[data-color="pink"] {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #f472b6;
}

.mb-card[data-color="green"] {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #34d399;
}

.mb-card[data-color="purple"] {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: #818cf8;
}

.mb-card[data-color="red"] {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-color: #f87171;
}

/* Icon Display */
.mb-icon {
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 32px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    animation: wiggle 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

.mb-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.mb-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--mb-primary-shadow);
    flex-shrink: 0;
}

.mb-info {
    flex: 1;
}

.mb-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 2px;
}

.mb-date {
    font-size: 11px;
    color: #94a3b8;
}

.mb-body {
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.mb-skeleton {
    break-inside: avoid;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: mb-shimmer 1.5s infinite;
    border-radius: 20px;
    padding: 20px;
    display: inline-block;
    width: 100%;
}

@keyframes mb-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.mb-skeleton-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.mb-skeleton-avatar {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.mb-skeleton-info {
    flex: 1;
}

.mb-skeleton-name {
    width: 60%;
    height: 14px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-bottom: 6px;
}

.mb-skeleton-date {
    width: 40%;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.mb-skeleton-body {
    height: 60px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* ============================================
   LINK VER MAIS & FIM
   ============================================ */

.mb-load-more {
    text-align: center;
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Link discreto */
.mb-link-load {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mb-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mb-link-load:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--mb-primary);
    text-decoration: none;
}

.mb-link-load i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.mb-link-load:hover i {
    transform: translateY(2px);
}

.mb-link-load strong {
    color: var(--mb-primary);
}

/* Spinner inline */
.mb-spinner-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 14px;
}

.mb-spinner-inline .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--mb-primary);
    border-radius: 50%;
    animation: mb-spin 0.8s linear infinite;
}

@keyframes mb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Botão principal "Deixar uma Mensagem" */
.mb-btn {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--mb-primary-shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.mb-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px var(--mb-primary-shadow);
    color: white;
}

.mb-btn i {
    font-size: 16px;
}


.mb-end {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    margin: 32px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mb-end i {
    font-size: 64px;
    color: var(--mb-primary);
    margin-bottom: 16px;
}

/* ============================================
   MOBILE CAROUSEL
   ============================================ */

.mb-carousel {
    display: none;
}

@media (max-width: 640px) {
    .mb-carousel {
        display: block;
    }

    .mb-title {
        font-size: 28px;
    }

    .mb-counter {
        display: none;
    }

    /* Oculta contador no topo no mobile pois tem no controle? */
    .mb-load-more {
        display: none !important;
    }

    /* Oculta Load More no mobile */
    /* Fim do carousel */
    #mbEndDesktop {
        display: none !important;
    }

    /* Garante que o fim do desktop não apareça */
}

.mb-carousel-wrapper {
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 20px;
    padding: 10px 5px;
    position: relative;
}

.mb-carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mb-carousel-slide {
    min-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.mb-carousel-slide .mb-card {
    height: 100%;
    margin-bottom: 0;
}

/* Navegação moderna com dots */
.mb-carousel-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

/* Dots de navegação */
.mb-carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 0;
}

.mb-carousel-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.mb-carousel-dot.active {
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--mb-primary-shadow);
}

/* Botões de navegação - Floating style */
.mb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--mb-primary-shadow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--mb-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 10;
}

.mb-nav-btn.prev {
    left: 5px;
}

.mb-nav-btn.next {
    right: 5px;
}

.mb-nav-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.mb-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
}

.mb-nav-btn:not(:disabled):hover {
    background: linear-gradient(135deg, var(--mb-primary) 0%, var(--mb-primary-light) 100%);
    color: white;
    border-color: var(--mb-primary);
    box-shadow: 0 6px 16px var(--mb-primary-shadow);
}

/* Info do contador - mais sutil */
.mb-carousel-info {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    background: white;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mb-carousel-info .current {
    color: var(--mb-primary);
    font-size: 16px;
    font-weight: 800;
}