/* Interactive HID Descriptor Styles */

.hid-descriptor-container {
    margin: 2em 0;
    padding: 1.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hid-descriptor-title {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 1em;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hid-bytes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 1em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.hid-byte {
    position: relative;
    min-width: 60px;
    padding: 12px 8px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: 2px solid #4a5568;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    font-weight: bold;
    text-align: center;
    cursor: help;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hid-byte:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
    background: linear-gradient(145deg, #f0f4ff, #e0e8ff);
    z-index: 10;
}

.hid-byte-value {
    display: block;
    color: #2d3748;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.hid-byte-label {
    display: block;
    color: #4a5568;
    font-size: 0.7em;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tooltip styles */
.hid-byte-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #2d3748;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 300px;
    white-space: normal;
    min-width: 200px;
}

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

.hid-byte:hover .hid-byte-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.hid-byte-tooltip-title {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #90cdf4;
    font-size: 1.05em;
}

.hid-byte-tooltip-desc {
    display: block;
    line-height: 1.4;
    color: #e2e8f0;
}

/* Type-based coloring */
.hid-byte-main {
    background: linear-gradient(145deg, #ffd4d4, #ffb3b3);
    border-color: #e53e3e;
}

.hid-byte-main:hover {
    background: linear-gradient(145deg, #ffe5e5, #ffc9c9);
}

.hid-byte-global {
    background: linear-gradient(145deg, #d4e4ff, #b3d1ff);
    border-color: #3182ce;
}

.hid-byte-global:hover {
    background: linear-gradient(145deg, #e5f0ff, #cce0ff);
}

.hid-byte-local {
    background: linear-gradient(145deg, #d4ffd4, #b3ffb3);
    border-color: #38a169;
}

.hid-byte-local:hover {
    background: linear-gradient(145deg, #e5ffe5, #c9ffc9);
}

.hid-byte-data {
    background: linear-gradient(145deg, #fffacd, #fff59d);
    border-color: #d69e2e;
}

.hid-byte-data:hover {
    background: linear-gradient(145deg, #ffffde, #ffffb3);
}

/* Descriptor explanation section */
.descriptor-explanation {
    margin-top: 1.5em;
    padding: 1.5em;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.descriptor-explanation h4 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.1em;
}

.descriptor-explanation p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 0.8em;
}

.descriptor-explanation code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #e53e3e;
}

/* Binary breakdown styles */
.binary-breakdown {
    margin: 1.5em 0;
    padding: 1em;
    background: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.binary-breakdown-title {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.5em;
}

.binary-bits {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #2d3748;
    letter-spacing: 2px;
    margin: 0.5em 0;
}

.binary-explanation {
    font-size: 0.9em;
    color: #4a5568;
    margin-top: 0.5em;
}

/* Legend */
.hid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-top: 1em;
    padding: 1em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    justify-content: center;
}

.hid-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #2d3748;
}

.hid-legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.hid-legend-box.main {
    background: linear-gradient(145deg, #ffd4d4, #ffb3b3);
    border-color: #e53e3e;
}

.hid-legend-box.global {
    background: linear-gradient(145deg, #d4e4ff, #b3d1ff);
    border-color: #3182ce;
}

.hid-legend-box.local {
    background: linear-gradient(145deg, #d4ffd4, #b3ffb3);
    border-color: #38a169;
}

.hid-legend-box.data {
    background: linear-gradient(145deg, #fffacd, #fff59d);
    border-color: #d69e2e;
}

/* Report structure visualization */
.report-structure {
    margin: 2em 0;
    padding: 1.5em;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-structure-title {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 1em;
    font-size: 1.1em;
}

.report-field {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.report-field:hover {
    background: #edf2f7;
    transform: translateX(4px);
}

.report-field-name {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2d3748;
}

.report-field-type {
    padding: 4px 12px;
    background: white;
    border-radius: 4px;
    font-size: 0.85em;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

/* Responsive design */
@media (max-width: 768px) {
    .hid-byte {
        min-width: 50px;
        padding: 10px 6px;
        font-size: 0.85em;
    }

    .hid-byte-tooltip {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90vw;
        bottom: auto;
    }

    .hid-byte-tooltip::after {
        display: none;
    }

    .hid-bytes-container {
        gap: 6px;
        padding: 0.8em;
    }
}
