:root {
    --bg-color: #0f1115;
    --panel-bg: #181b21;
    --accent-color: #646cff;
    --accent-hover: #7c83ff;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: #2f333c;
    --disabled-opacity: 0.3;
    --danger-color: #ff5555;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

header {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: var(--text-main);
}

.tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

/* Views */
.view-container {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.view-container.active {
    display: flex;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0; /* Important for scrolling inside grid items */
}

.grid-layout.two-col {
    grid-template-columns: 1fr 2fr;
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel h2 {
    padding: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Scrollbar styling */
.list-container::-webkit-scrollbar {
    width: 8px;
}
.list-container::-webkit-scrollbar-track {
    background: transparent;
}
.list-container::-webkit-scrollbar-thumb {
    background: #3f434e;
    border-radius: 4px;
}

/* Interactive Items */
.option-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-item:hover:not(.disabled) {
    background-color: rgba(255, 255, 255, 0.08);
}

.option-item.active {
    background-color: rgba(100, 108, 255, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
}

.option-item.disabled {
    opacity: var(--disabled-opacity);
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-name {
    font-size: 1rem;
}

.item-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #2a2e37;
    border-radius: 4px;
    color: var(--text-muted);
}

/* Result Panel */
.result-panel {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.result-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

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

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.result-card {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.meta-info h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.meta-info p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

.graph-card {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.graph-card h3 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

canvas {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-left: 1px solid #333;
    border-bottom: 1px solid #333;
}

/* Models Tab Specifics */
.model-detail-block {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.model-detail-block:last-child {
    border-bottom: none;
}

.model-detail-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.model-detail-value {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.5;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.param-card {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.param-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.param-card .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-color);
}