/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #58a6ff;
}

.disclaimer {
    font-size: 13px;
    color: #e3b341;
    background: rgba(187, 128, 9, 0.15);
    border-left: 3px solid #d29922;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.stats-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #8b949e;
    font-size: 14px;
}

.stat-value {
    color: #c9d1d9;
    font-weight: 600;
    font-size: 14px;
}

.stat-percentage {
    color: #58a6ff;
    font-size: 14px;
}

/* Main content layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 20px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
}

.section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #c9d1d9;
}

/* Search container */
.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-container input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
    outline: none;
}

.search-container input:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.search-container button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    display: none;
}

.search-container button:hover {
    color: #c9d1d9;
}

/* Filter options */
.filter-options {
    margin-bottom: 15px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #c9d1d9;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-box {
    width: 12px;
    height: 12px;
    border: 1px solid #30363d;
    display: inline-block;
}

/* Heatmap */
.heatmap-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}

.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.heatmap-cell:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 2px #58a6ff;
    z-index: 10;
    position: relative;
}

.heatmap-cell.dimmed {
    opacity: 0.2;
}

.heatmap-cell.highlighted {
    box-shadow: 0 0 0 2px #f85149;
}

.heatmap-cell.active {
    box-shadow: 0 0 0 3px #58a6ff !important;
    transform: scale(1.3);
    z-index: 10;
    position: relative;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.sidebar-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
}

.sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8b949e;
}

.sidebar-details h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #58a6ff;
    word-break: break-word;
}

.sidebar-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 14px;
    color: #c9d1d9;
}

.status-complete {
    color: #3fb950;
    font-weight: 600;
}

.status-partial {
    color: #d29922;
    font-weight: 600;
}

.status-none {
    color: #f85149;
    font-weight: 600;
}

/* Functions list in sidebar */
.functions-list {
    margin-top: 15px;
}

.function-item {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    border-left: 3px solid;
}

.function-item.fn-reversed {
    background: rgba(63, 185, 80, 0.1);
    border-left-color: #3fb950;
}

.function-item.fn-not-reversed {
    background: rgba(248, 81, 73, 0.1);
    border-left-color: #f85149;
}

.function-name {
    font-size: 13px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.function-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.function-address {
    color: #8b949e;
    font-family: 'Courier New', monospace;
}

.function-status {
    font-size: 10px;
    font-weight: 600;
}

.fn-reversed .function-status {
    color: #3fb950;
}

.fn-not-reversed .function-status {
    color: #f85149;
}

/* Commands section */
.commands-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3fb950 0%, #58a6ff 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #8b949e;
    text-align: center;
}

.commands-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.commands-column h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #c9d1d9;
}

.command-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px;
}

.command-list li {
    padding: 3px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    transition: background-color 0.2s ease;
    line-height: 1.3;
}

.command-list li:hover {
    background: #21262d;
}

.command-list li.active {
    background: #1f6feb;
    color: #ffffff;
}

/* Scrollbar styling */
.heatmap-container::-webkit-scrollbar,
.command-list::-webkit-scrollbar {
    width: 8px;
}

.heatmap-container::-webkit-scrollbar-track,
.command-list::-webkit-scrollbar-track {
    background: #0d1117;
}

.heatmap-container::-webkit-scrollbar-thumb,
.command-list::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.heatmap-container::-webkit-scrollbar-thumb:hover,
.command-list::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .commands-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .stats-banner {
        flex-direction: column;
        gap: 10px;
    }
    
    .section {
        padding: 15px;
    }
    
    .heatmap-container {
        max-height: 400px;
    }
}
