/* ===== FITA DE SIMULAÇÃO ===== */

.tape-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #e3e9f0 100%);
    border-top: 3px solid #2196f3;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
    padding: 16px;
    animation: slideUp 0.3s ease;
    
    /* OVERLAY FIXO */
    position: fixed !important;
    bottom: 0;
    left: 195px; /* Largura da sidebar esquerda */
    right: 300px; /* Largura da sidebar direita */
    height: 320px; /* Altura aumentada para melhor visualização */
    
    z-index: 9999 !important;
    box-sizing: border-box;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.tape-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.tape-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tape-title::before {
    content: '📼';
    font-size: 16px;
}

.tape-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botão de fechar */
.tape-close {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.tape-close:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.tape-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tape-btn:hover {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.tape-btn:active {
    transform: translateY(0);
}

.tape-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tape-speed {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Track da Fita */
.tape-track {
    position: relative;
    height: 80px;
    background: white;
    border: 2px solid #2196f3;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    /* Estilo de scroll customizado */
    scrollbar-width: thin;
    scrollbar-color: #2196f3 #f0f0f0;
}

.tape-track::-webkit-scrollbar {
    height: 8px;
}

.tape-track::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.tape-track::-webkit-scrollbar-thumb {
    background: #2196f3;
    border-radius: 4px;
}

.tape-track::-webkit-scrollbar-thumb:hover {
    background: #1976d2;
}

/* Células da Fita */
.tape-cells {
    display: flex;
    align-items: center;
    padding: 20px 50px;
    min-width: 100%;
    height: 100%;
}

.tape-cell {
    min-width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: white;
    margin: 0 2px;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tape-cell.empty {
    background: #f9f9f9;
    color: #ccc;
    border-style: dashed;
}

.tape-cell.current {
    background: linear-gradient(135deg, #fff9c4 0%, #ffeb3b 100%);
    border-color: #fbc02d;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(251, 192, 45, 0.4);
    animation: pulse 0.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.15);
    }
}

.tape-cell.read {
    background: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%);
    border-color: #66bb6a;
    animation: fadeToGreen 0.5s ease;
}

@keyframes fadeToGreen {
    from {
        background: #ffeb3b;
    }
    to {
        background: #a5d6a7;
    }
}

.tape-cell.accepted {
    background: linear-gradient(135deg, #c8e6c9 0%, #4caf50 100%);
    border-color: #388e3c;
    color: white;
    animation: acceptBounce 0.5s ease;
}

@keyframes acceptBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.tape-cell.rejected {
    background: linear-gradient(135deg, #ffcdd2 0%, #f44336 100%);
    border-color: #d32f2f;
    color: white;
    animation: rejectShake 0.5s ease;
}

@keyframes rejectShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Cabeçote de Leitura */
.tape-head {
    position: absolute;
    top: -10px;
    left: 50px;
    transition: left 0.5s ease-in-out;
    z-index: 10;
}

.tape-head-arrow {
    font-size: 32px;
    color: #2196f3;
    filter: drop-shadow(0 2px 4px rgba(33, 150, 243, 0.5));
    animation: headBounce 1s ease-in-out infinite;
}

@keyframes headBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Info da Fita */
.tape-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 12px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    color: #666;
}

.tape-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tape-info strong {
    color: #2196f3;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 768px) {
    .tape-container {
        padding: 12px;
    }
    
    .tape-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .tape-controls {
        width: 100%;
        justify-content: center;
    }
    
    .tape-cell {
        min-width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .tape-info {
        flex-direction: column;
        gap: 8px;
    }
}

/* Efeitos especiais */
.tape-container.accepting {
    border-top-color: #4caf50;
    animation: flashGreen 0.5s ease 3;
}

.tape-container.rejecting {
    border-top-color: #f44336;
    animation: flashRed 0.5s ease 3;
}

@keyframes flashGreen {
    0%, 100% {
        border-top-color: #4caf50;
    }
    50% {
        border-top-color: #81c784;
    }
}

@keyframes flashRed {
    0%, 100% {
        border-top-color: #f44336;
    }
    50% {
        border-top-color: #e57373;
    }
}
