/* ========================================
   CSS para Gráfico Dinâmico de Vendas
   RestauranteMax Pro Dashboard
   ======================================== */

/* Status indicator */
.status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
    z-index: 10;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Wrapper do gráfico */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

/* Área principal do gráfico */
.chart-area {
    display: flex;
    height: 280px;
    position: relative;
}

/* Eixo Y (vertical) */
.y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 100%;
    padding-right: 10px;
    position: relative;
}

.y-label {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    font-weight: 500;
    line-height: 1;
    position: relative;
}

.y-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 1px;
    background-color: #dee2e6;
}

/* Grade do gráfico */
.chart-grid {
    flex: 1;
    position: relative;
    height: 100%;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.grid-line {
    height: 1px;
    background-color: #f1f3f4;
    width: 100%;
}

/* Container das barras */
.bars-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
    padding: 0 5px;
    gap: 4px;
}

/* Grupo de barra (barra + label) */
.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    max-width: 70px;
    position: relative;
}

/* Barra individual */
.bar {
    width: 100%;
    height: 90%;
    position: relative;
    border-radius: 8px 8px 0 0;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
}

.bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Preenchimento da barra */
.bar-fill {
    width: 100%;
    height: 0%;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Valor da barra */
.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: #333;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bar:hover .bar-value {
    opacity: 1;
}

/* Labels das bebidas */
.bar-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
}

/* ========================================
   CORES ESPECÍFICAS PARA CADA BEBIDA
   ======================================== */

.bar-cerveja .bar-fill {
    background: linear-gradient(180deg, #ffd700, #ffed4e);
    box-shadow: inset 0 -2px 10px rgba(255, 193, 7, 0.3);
}

.bar-vodka .bar-fill {
    background: linear-gradient(180deg, #e3f2fd, #90caf9);
    box-shadow: inset 0 -2px 10px rgba(33, 150, 243, 0.3);
}

.bar-whisky .bar-fill {
    background: linear-gradient(180deg, #8d6e63, #a1887f);
    box-shadow: inset 0 -2px 10px rgba(121, 85, 72, 0.3);
}

.bar-amarula .bar-fill {
    background: linear-gradient(180deg, #ffcc80, #ffb74d);
    box-shadow: inset 0 -2px 10px rgba(255, 152, 0, 0.3);
}

.bar-caipirinha .bar-fill {
    background: linear-gradient(180deg, #c8e6c9, #81c784);
    box-shadow: inset 0 -2px 10px rgba(76, 175, 80, 0.3);
}

.bar-gin .bar-fill {
    background: linear-gradient(180deg, #f3e5f5, #ce93d8);
    box-shadow: inset 0 -2px 10px rgba(156, 39, 176, 0.3);
}

.bar-refrigerante .bar-fill {
    background: linear-gradient(180deg, #ffcdd2, #ef5350);
    box-shadow: inset 0 -2px 10px rgba(244, 67, 54, 0.3);
}

.bar-agua .bar-fill {
    background: linear-gradient(180deg, #e1f5fe, #4fc3f7);
    box-shadow: inset 0 -2px 10px rgba(3, 169, 244, 0.3);
}

.bar-drink .bar-fill {
    background: linear-gradient(180deg, #fff3e0, #ffcc02);
    box-shadow: inset 0 -2px 10px rgba(255, 193, 7, 0.3);
}

.bar-rum .bar-fill {
    background: linear-gradient(180deg, #795548, #6d4c41);
    box-shadow: inset 0 -2px 10px rgba(121, 85, 72, 0.3);
}

.bar-vinho .bar-fill {
    background: linear-gradient(180deg, #880e4f, #ad1457);
    box-shadow: inset 0 -2px 10px rgba(136, 14, 79, 0.3);
}

.bar-combo .bar-fill {
    background: linear-gradient(180deg, #4a148c, #7b1fa2);
    box-shadow: inset 0 -2px 10px rgba(74, 20, 140, 0.3);
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bar.pulse {
    animation: pulse 0.3s ease;
}

@keyframes newSale {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bar-group.new-sale {
    animation: newSale 0.6s ease;
}

.bar-group.new-sale .bar-label {
    color: #28a745;
    font-weight: 700;
}

/* ========================================
   INFORMAÇÕES DO GRÁFICO
   ======================================== */

.chart-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.time-indicator {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.time-indicator i {
    margin-right: 6px;
    color: #007bff;
}

.total-sales {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
}

/* ========================================
   BOTÕES DE PERÍODO
   ======================================== */

.btn-group .btn {
    transition: all 0.3s ease;
}

.btn-group .btn:not(.active):hover {
    background-color: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
}

.btn-group .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .chart-wrapper {
        height: 280px;
    }
    
    .chart-area {
        height: 240px;
    }
    
    .bars-container {
        gap: 2px;
        padding: 0 2px;
    }
    
    .bar-label {
        font-size: 10px;
    }
    
    .chart-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .status-indicator {
        top: 5px;
        right: 5px;
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .chart-wrapper {
        height: 250px;
    }
    
    .chart-area {
        height: 210px;
    }
    
    .bar-label {
        font-size: 9px;
        line-height: 1.1;
    }
    
    .y-label {
        font-size: 10px;
    }
    
    .bar-group {
        max-width: 25px;
    }
    
    .status-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        height: 220px;
    }
    
    .chart-area {
        height: 180px;
    }
    
    .bar-label {
        font-size: 8px;
    }
    
    .bar-group {
        max-width: 20px;
    }
    
    .btn-group .btn {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Ajustes específicos para orientação landscape em mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .chart-wrapper {
        height: 200px;
    }
    
    .chart-area {
        height: 160px;
    }
}