/**
 * Separação Item - CSS Específico
 * Estende app.css para funcionalidades de bipagem
 */

/* === SCANNER === */
.app-scanner-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(4, 120, 87, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--app-raio);
    color: var(--app-marca-claro);
}

.app-scanner-bar i {
    font-size: 1.25rem;
    animation: scanner-pulse 2s ease-in-out infinite;
}

@keyframes scanner-pulse {

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

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

.app-scanner-bar p {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.app-scanner-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* === LISTA DE ITENS === */
.app-itens-lista {
    background: var(--app-superficie);
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio-grande);
    padding: 1rem;
}

.app-itens-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-borda);
}

.app-itens-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--app-texto);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-itens-count {
    font-size: 0.75rem;
    color: var(--app-texto-opaco);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.app-btn-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--app-raio);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--app-borda);
    color: var(--app-texto-opaco);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 1.125rem;
}

.app-btn-toggle:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--app-marca);
    color: var(--app-marca);
}

.app-btn-toggle.ativo {
    background: var(--app-marca);
    border-color: var(--app-marca);
    color: white;
    box-shadow: var(--app-brilho-marca);
}

.app-itens-scroll {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.app-itens-scroll::-webkit-scrollbar {
    width: 4px;
}

.app-itens-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.app-itens-scroll::-webkit-scrollbar-thumb {
    background: var(--app-borda);
    border-radius: 9999px;
}

/* === ITEM CARD === */
.app-item {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.app-item-btn-qty {
    width: 44px;
    min-width: 44px;
    border: none;
    border-radius: var(--app-raio);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.app-item-btn-qty.menos {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    color: var(--app-perigo);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.app-item-btn-qty.menos:hover {
    background: var(--app-perigo);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.app-item-btn-qty.mais {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    color: var(--app-sucesso);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.app-item-btn-qty.mais:hover {
    background: var(--app-sucesso);
    color: white;
    box-shadow: var(--app-brilho-sucesso);
}

.app-item-btn-qty:active {
    transform: scale(0.95);
}

/* Item Content */
.app-item-label {
    flex: 1;
    cursor: pointer;
}

.app-item-label input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.app-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--app-superficie-elevada);
    border: 2px solid var(--app-borda);
    border-radius: var(--app-raio);
    transition: all 0.25s ease;
    min-height: 70px;
}

.app-item-label input[type="radio"]:checked+.app-item-content {
    border-color: var(--app-marca);
    background: rgba(16, 185, 129, 0.08);
}

.app-item-info {
    flex: 1;
    min-width: 0;
}

.app-item-nome {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-texto);
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.app-item-tag {
    padding: 0.125rem 0.375rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--app-borda);
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--app-texto-opaco);
}

.app-item-tag.id {
    color: var(--app-marca-claro);
    border-color: rgba(16, 185, 129, 0.25);
}

.app-item-tag.codigo {
    color: var(--app-texto);
    font-weight: 700;
}

/* Barcode Display */
.app-item-barcode {
    margin-top: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.375rem;
    display: none;
    align-items: center;
    gap: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
}

.app-item-barcode i {
    color: var(--app-marca);
}

.app-item-barcode span {
    color: var(--app-marca-claro);
    font-weight: 600;
}

.barcode-visivel .app-item-barcode {
    display: flex;
}

/* Quantity Display */
.app-item-qty {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.app-item-qty-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-sucesso);
}

.app-item-qty-valor.modificado {
    color: var(--app-marca);
}

.app-item-qty-total {
    font-size: 0.75rem;
    color: var(--app-texto-opaco);
}

/* Progress Mini */
.app-item-progresso {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-item-progresso-barra {
    width: 50px;
    height: 5px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.app-item-progresso-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--app-sucesso), #34d399);
    transition: width 0.3s ease;
}

.app-item-check {
    color: var(--app-sucesso);
    font-size: 1rem;
    display: none;
}

.app-item.completo .app-item-check {
    display: block;
}

.app-item.completo .app-item-content {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
}

/* === HIGHLIGHT ANIMAÇÕES === */
.app-item.highlight-scan {
    animation: item-scan-flash 0.8s ease-out;
}

@keyframes item-scan-flash {
    0% {
        background-color: rgba(16, 185, 129, 0.3);
    }

    100% {
        background-color: transparent;
    }
}

.app-item.highlight-error {
    animation: item-error-shake 0.5s ease-in-out;
}

@keyframes item-error-shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.app-item.highlight-error .app-item-content {
    border-color: var(--app-perigo) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* === SYNC STATUS === */
.app-sync-status {
    font-size: 0.75rem;
    color: var(--app-marca);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* === AÇÕES FOOTER === */
.app-acoes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.app-btn-concluir {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
    border: none;
    border-radius: var(--app-raio-grande);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.app-btn-concluir:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-brilho-sucesso);
}

.app-btn-concluir.pulse {
    animation: btn-concluir-pulse 2s infinite;
}

@keyframes btn-concluir-pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(16, 185, 129, 0.5);
    }
}

.app-btn-teste {
    width: 100%;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--app-borda);
    border-radius: var(--app-raio);
    color: var(--app-texto-opaco);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.app-btn-teste:hover {
    border-color: var(--app-marca);
    color: var(--app-texto);
}

/* === TELA DE FINALIZAÇÃO (Task 4) === */
.sep-final-icon-section {
    perspective: 1000px;
    margin-bottom: 2rem;
}

.sep-final-icon-section i {
    animation: truck-float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes truck-float {

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

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

.sep-finalizacao-stats {
    animation: stats-fade-in 0.8s ease-out;
}

@keyframes stats-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-3px);
}

.btn-finalizar-missao-final {
    animation: btn-finalizar-glow 2s infinite;
}

@keyframes btn-finalizar-glow {

    0%,
    100% {
        box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
    }

    50% {
        box-shadow: 0 8px 45px rgba(34, 197, 94, 0.6);
    }
}

.item-finalizacao {
    border: 1px dashed rgba(34, 197, 94, 0.4) !important;
    background: rgba(34, 197, 94, 0.03) !important;
    margin-top: 10px;
    border-radius: 12px;
}

.item-finalizacao.selecionado {
    background: rgba(34, 197, 94, 0.08) !important;
    border: 1px solid var(--app-sucesso) !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}

.item-finalizacao .sep-modal-item-nome {
    letter-spacing: 0.5px;
}
:root, #separacao-app {
    --app-marca: #10b981;
    --app-marca-rgb: 16, 185, 129;
    --app-marca-claro: #34d399;
    --app-brilho-marca: 0 0 15px rgba(16, 185, 129, 0.4);
}
