/* Community Specific Styles - Premium Glassmorphism Design */
.community-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    margin-top: 2rem;
}

.community-header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.community-header h1 {
    font-size: 2.8rem;
    color: var(--color-wood);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.community-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--color-highlight);
    border-radius: 2px;
}

.community-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Glassmorphism Card Style */
.mq-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(61, 43, 31, 0.15);
    margin-bottom: 1rem;
}



.card-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mq-card:hover .card-image {
    transform: scale(1.05);
}

.phase-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-wood);
    color: var(--color-highlight);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card-content {
    padding: 1.8rem;
    flex-grow: 1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    /* Square with soft corners */
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-wood) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.avatar-ai {
    background: var(--color-highlight);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-family: var(--font-clean);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-wood);
}

.post-date {
    font-size: 0.75rem;
    color: #8a7362;
}

.post-text {
    font-size: 0.95rem;
    color: #4a3424;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

/* Macro Bar */
.macro-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px 10px;
    background: #fffcf8;
    padding: 22px 15px;
    border-radius: 18px;
    margin: 1.5rem 0;
    border: 1.5px solid var(--color-highlight);
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.08);
}

.macro-item {
    text-align: center;
}

.macro-value {
    display: block;
    font-weight: 800;
    color: var(--color-wood);
    /* More readable than accent on light bg */
    font-size: 1.15rem;
    font-family: var(--font-clean);
    margin-bottom: 2px;
}

.macro-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #6d5a4d;
    letter-spacing: 0.5px;
    font-weight: 700;
    opacity: 0.9;
}

/* AI Coaching Element */
.ai-response {
    background: rgba(212, 175, 55, 0.1);
    border-left: 3px solid var(--color-highlight);
    padding: 12px 15px;
    border-radius: 0 12px 12px 0;
    margin-top: 1rem;
    position: relative;
}

.ai-coach-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #927a2b;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.card-actions {
    padding: 0.6rem 1.8rem 1.2rem;
    background: rgba(61, 43, 31, 0.02);
    border-top: 1px solid rgba(61, 43, 31, 0.05);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.btn-clone {
    background: var(--color-wood);
    color: var(--color-highlight);
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-family: var(--font-clean);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(61, 43, 31, 0.2);
}

.btn-clone:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(61, 43, 31, 0.3);
}

.interaction-group {
    display: flex;
    gap: 20px;
    color: var(--color-accent);
}

.interaction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.interaction-item:hover {
    color: var(--color-highlight);
}

.interaction-item span {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-clean);
}

/* Float Share Button */
.share-float {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    background: var(--color-accent);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
}

.share-float:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--color-wood);
}

@media (max-width: 480px) {
    .community-grid {
        grid-template-columns: 1fr;
    }

    .community-header h1 {
        font-size: 2rem;
    }

    .mq-card {
        border-radius: 16px;
    }
}

/* ─── Post Meal Table Styles — pixel-perfect mirror of tablas.html ─────────── */

.saved-meal-panel {
    background: white;
    border: 1.5px solid #c4a484;
    /* var(--accent-color) en tablas */
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(139, 90, 43, 0.10);
    margin-bottom: 12px;
    overflow: hidden;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saved-meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(90deg, #f8f1e9, #fff8ee);
    border-bottom: 1px solid #e8e1d5;
    /* var(--border-color) */
}

.saved-meal-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #8b5a2b;
    /* var(--primary-color) */
    margin: 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Scroll wrapper — habilita scroll horizontal en tarjetas estrechas */
.post-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.post-table-scroll::-webkit-scrollbar {
    height: 5px;
}

.post-table-scroll::-webkit-scrollbar-track {
    background: #f8f1e9;
}

.post-table-scroll::-webkit-scrollbar-thumb {
    background: #c4a484;
    border-radius: 10px;
}

/* Tabla */
.summaryTable {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.95rem;
    /* igual que tablas.html */
    text-align: left;
}

/* Cabeceras — idénticas a tablas.html */
.summaryTable th {
    background: #f8f1e9;
    color: #8b5a2b;
    font-family: 'Cinzel', serif;
    padding: 10px 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-bottom: 2px solid #e8e1d5;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: static !important;
    cursor: default !important;
}

/* Celdas de datos — idénticas a tablas.html td */
.summaryTable td {
    padding: 8px 8px;
    border-bottom: 1px solid #e8e1d5;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: #2c1e13;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Nombre de alimento */
.summaryTable .name-cell {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #2c1e13;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    padding: 0;
}

/* Zebra striping — exacto al de tablas.html */
.summaryTable tbody tr:not(.total-row):nth-child(even) td {
    background-color: #faf7f2;
}

.summaryTable tbody tr:not(.total-row):hover td {
    background-color: #f1ebd5;
}

/* Icono de categoría */
.summary-icon {
    width: 20px;
    color: #c4a484;
    opacity: 1;
    margin-right: 8px;
    display: inline-block;
    text-align: center;
    flex-shrink: 0;
}

/* Fila de totales — mismos valores que .total-row en tablas.html */
.summaryTable tfoot .total-row td,
.summaryTable tbody .total-row td {
    background: #fdf6ec !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    color: #8b5a2b !important;
    padding: 12px 8px !important;
    border-top: 2px solid #e8e1d5 !important;
    font-size: 0.9rem !important;
}

.summaryTable tfoot .total-row td.col-name,
.summaryTable tbody .total-row td.col-name {
    font-family: 'Cinzel', serif !important;
}

/* Input de cantidad — idéntico al de tablas.html */
.qty-input {
    width: 54px;
    padding: 3px 5px;
    border: 1px solid #e0d8cc;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    text-align: center;
    background: #faf8f5;
    color: #7a6555;
    margin: 0 auto;
    display: block;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qty-input.has-value {
    border-color: #c4a484;
    background: #fff8ee;
    font-weight: 600;
}

/* ─── Anchos de columna — copia exacta de tablas.html ─────────────────────── */
.col-name {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.col-qty {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: center;
}

.col-kcal {
    width: 65px;
    min-width: 65px;
    max-width: 65px;
    text-align: center;
}

.col-kr {
    width: 65px;
    min-width: 65px;
    max-width: 65px;
    text-align: center;
}

.col-prot {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: center;
}

.col-kp {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

.col-fibra {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: center;
}

.col-grasa {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: center;
}

.col-hc {
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    text-align: center;
}

.col-ig {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}


/* Community Navigation Bar */
.community-nav-bar {
    background: #fffcf8;
    border-bottom: 1px solid rgba(139, 90, 43, 0.1);
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.community-nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 0 1rem;
}

.nav-item {
    padding: 18px 10px;
    color: #8b7361;
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.nav-item i {
    font-size: 1rem;
}

.nav-item:hover {
    color: var(--color-wood);
    opacity: 1;
}

.nav-item.active {
    color: var(--color-wood);
    opacity: 1;
    border-bottom-color: var(--color-accent);
}

@media (max-width: 768px) {
    .community-nav-container {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 25px;
        scrollbar-width: none;
        /* Firefox */
    }

    .community-nav-container::-webkit-scrollbar {
        display: none;
        /* Safari/Chrome */
    }

    .nav-item {
        white-space: nowrap;
        padding: 15px 5px;
        font-size: 0.75rem;
    }
}