/* =========================================================
   3.06 Input Devices Explorer Widget
   ========================================================= */

.input-devices-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #dbeafe;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.input-device-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.input-device-tabs button,
.input-device-controls button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    color: #334155;
    padding: 0.6rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-device-tabs button:hover,
.input-device-controls button:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    color: #1d4ed8;
}

.input-device-tabs button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.input-device-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.95fr);
    gap: 1rem;
    align-items: stretch;
}

.input-device-visual,
.input-device-panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 1rem;
}

.input-device-stage {
    min-height: 320px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.input-device-label {
    margin: 0 0 0.5rem;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.input-device-panel h3 {
    margin-top: 0;
    color: #0f172a;
}

.input-device-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
}

.input-device-progress {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 1rem 0;
}

.input-device-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
    transition: width 0.25s ease;
}

.input-device-exam-focus {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
    line-height: 1.55;
}

.device-diagram {
    width: min(440px, 96%);
    min-height: 260px;
    display: grid;
    place-items: center;
    position: relative;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 20px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.keyboard-key {
    width: 56px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: white;
    border: 1px solid #cbd5e1;
    font-weight: 900;
    color: #334155;
    box-shadow: 0 6px 0 #cbd5e1;
    transition: all 0.25s ease;
}

.keyboard-key.active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #cbd5e1;
    background: #dbeafe;
    border-color: #2563eb;
    color: #1d4ed8;
}

.matrix-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.matrix-line-row,
.matrix-line-col {
    position: absolute;
    background: rgba(37, 99, 235, 0.22);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.matrix-line-row.active,
.matrix-line-col.active {
    opacity: 1;
}

.matrix-line-row {
    height: 4px;
    width: 84%;
    left: 8%;
    top: 50%;
}

.matrix-line-col {
    width: 4px;
    height: 84%;
    top: 8%;
    left: 50%;
}

.flow-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: white;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.flow-pill.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.flow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.flow-arrow {
    color: #64748b;
    font-weight: 900;
}

.touch-phone {
    width: 190px;
    height: 280px;
    border-radius: 34px;
    background: #0f172a;
    padding: 0.8rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    position: relative;
}

.touch-screen-inner {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: linear-gradient(180deg, #dbeafe, #f8fafc);
    display: grid;
    place-items: center;
    color: #334155;
    font-weight: 800;
    text-align: center;
}

.touch-dot {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.32);
    border: 2px solid #2563eb;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    transition: all 0.25s ease;
}

.touch-dot.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.scanner-bed {
    width: 310px;
    height: 220px;
    border-radius: 22px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 10px white;
}

.scanner-paper {
    position: absolute;
    inset: 28px 42px;
    border-radius: 12px;
    background: white;
    border: 1px solid #cbd5e1;
}

.scanner-line {
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 48px;
    width: 8px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.65);
    transition: left 0.35s ease;
}

.scanner-line.step-2 { left: 145px; }
.scanner-line.step-3,
.scanner-line.step-4 { left: 245px; }

.ccd-chip {
    position: absolute;
    right: 20px;
    bottom: 20px;
    padding: 0.4rem 0.65rem;
    border-radius: 12px;
    background: #0f172a;
    color: white;
    font-weight: 800;
    opacity: 0.35;
    transition: opacity 0.25s ease;
}

.ccd-chip.active { opacity: 1; }

@media (max-width: 820px) {
    .input-device-layout {
        grid-template-columns: 1fr;
    }

    .input-device-stage {
        min-height: 260px;
    }
}
