/* =========================================
   FRESHNESS INDICATOR (Vigor)
   ========================================= */

.freshness-indicator {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px solid #bbf7d0;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-height: 220px;
    /* Altura mínima igual */
    cursor: help;
}

.freshness-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
    border-color: #86efac;
}

.freshness-icon {
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.freshness-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Mudado de space-between para flex-start */
    min-height: 100%;
}

.freshness-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* Aumentado para dar mais espaço */
}

.freshness-title {
    font-size: 20px;
    /* MESMO TAMANHO DO LEVEL-NAME */
    font-weight: 700;
    /* MESMO PESO */
    color: #166534;
    /* Verde escuro */
    margin: 0;
    line-height: 1.2;
}

.freshness-percentage {
    font-size: 24px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1;
}

.freshness-bar {
    width: 100%;
    height: 12px;
    background: #dcfce7;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-top: auto;
    /* Empurra a barra para baixo (mesma posição da roxa) */
    margin-bottom: 40px;
    /* Aumentado para 40px para alinhar com a barra dde nível */
}

.freshness-description {
    font-size: 13px;
    /* Reduzido para 13px (igual ao level-next) */
    color: #16a34a;
    margin: 0;
    line-height: 1.4;
}

.freshness-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.freshness-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Estados do Freshness */
.freshness-indicator.high {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.freshness-indicator.medium {
    background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
    border-color: #fde047;
}

.freshness-indicator.medium .freshness-title {
    color: #854d0e;
}

.freshness-indicator.medium .freshness-percentage {
    color: #eab308;
}

.freshness-indicator.medium .freshness-description {
    color: #a16207;
}

.freshness-indicator.medium .freshness-fill {
    background: linear-gradient(90deg, #facc15 0%, #eab308 100%);
}

.freshness-indicator.low {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-color: #fecaca;
}

.freshness-indicator.low .freshness-title {
    color: #991b1b;
}

.freshness-indicator.low .freshness-percentage {
    color: #ef4444;
}

.freshness-indicator.low .freshness-description {
    color: #dc2626;
}

.freshness-indicator.low .freshness-fill {
    background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
}

.freshness-indicator.critical {
    background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
    border-color: #fca5a5;
    animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {

    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    }

    50% {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
    }
}

.freshness-indicator.critical .freshness-title {
    color: #7f1d1d;
}

.freshness-indicator.critical .freshness-percentage {
    color: #dc2626;
}

.freshness-indicator.critical .freshness-description {
    color: #b91c1c;
}

.freshness-indicator.critical .freshness-fill {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* Tooltip */
.freshness-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.freshness-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.freshness-indicator:hover .freshness-tooltip {
    opacity: 1;
}

/* Responsividade */
@media (max-width: 640px) {
    .freshness-indicator {
        padding: 20px;
    }

    .freshness-icon {
        font-size: 32px;
    }

    .freshness-percentage {
        font-size: 20px;
    }

    .freshness-title {
        font-size: 18px;
    }
}