/* ═══════════════════════════════════════════
   ChemVerse — 3D Molecular Viewer Styles
   ═══════════════════════════════════════════ */

.mol3d-layout {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 0;
    height: calc(100vh - 56px);
    padding-top: 56px;
}

/* ─── Sidebar ─── */
.mol3d-sidebar {
    background: rgba(15, 15, 35, 0.85);
    border-right: 1px solid rgba(99, 102, 241, 0.12);
    overflow-y: auto;
    padding: 14px 10px;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-section h3 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(148, 163, 184, 0.5);
    margin: 0 0 8px;
}

.molecule-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mol-btn {
    width: 100%;
    padding: 8px 10px;
    background: rgba(30, 30, 60, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mol-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}

.mol-btn.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.4);
}

.mol-btn-name {
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
}

.mol-btn-formula {
    font-size: 10px;
    color: #818cf8;
    font-weight: 600;
    font-family: 'Inter', monospace;
}

/* ─── View Mode Toggles ─── */
.mode-toggles {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mode-btn,
.color-btn {
    width: 100%;
    padding: 7px 10px;
    background: rgba(30, 30, 60, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 6px;
    color: rgba(148, 163, 184, 0.7);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.mode-btn:hover,
.color-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #e2e8f0;
}

.mode-btn.active,
.color-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #e2e8f0;
}

.mode-icon {
    margin-right: 4px;
}

/* ─── Toggles ─── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.7);
}

.toggle-label input[type="checkbox"] {
    accent-color: #6366f1;
    width: 14px;
    height: 14px;
}

/* ─── Viewport ─── */
.viewport-area {
    display: flex;
    flex-direction: column;
    background: rgba(4, 4, 16, 0.6);
    position: relative;
}

.viewport-toolbar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(15, 15, 35, 0.5);
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    position: relative;
    z-index: 5;
    align-items: center;
}

.viewport-info {
    margin-left: auto;
    font-size: 10px;
    color: rgba(148, 163, 184, 0.35);
}

.viewport-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.viewport-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ─── Info Panel ─── */
.info-panel {
    background: rgba(15, 15, 35, 0.85);
    border-left: 1px solid rgba(99, 102, 241, 0.12);
    overflow-y: auto;
    padding: 14px 12px;
}

.info-section {
    margin-bottom: 16px;
}

.info-section h3 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(148, 163, 184, 0.5);
    margin: 0 0 8px;
}

.info-card {
    background: rgba(30, 30, 60, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    padding: 12px;
}

.info-name {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.info-formula {
    font-size: 20px;
    font-weight: 800;
    color: #818cf8;
    font-family: 'Inter', monospace;
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.info-item {
    background: rgba(20, 20, 50, 0.5);
    border-radius: 6px;
    padding: 6px 8px;
}

.info-item-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(148, 163, 184, 0.4);
    margin-bottom: 2px;
}

.info-item-value {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.info-item-value.exo {
    color: #f97316;
}

.info-item-value.endo {
    color: #3b82f6;
}

/* ─── Bond List ─── */
.bond-list-3d {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bond-item-3d {
    background: rgba(30, 30, 60, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bond-item-pair {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.bond-item-meta {
    font-size: 9px;
    color: rgba(148, 163, 184, 0.5);
}

.bond-type-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.bond-type-tag.polar {
    background: rgba(100, 170, 255, 0.15);
    color: #60a5fa;
}

.bond-type-tag.nonpolar {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.bond-type-tag.ionic {
    background: rgba(255, 200, 100, 0.15);
    color: #fbbf24;
}

/* ─── Geometry Info ─── */
.geometry-info {
    background: rgba(30, 30, 60, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    padding: 10px;
}

.geom-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    font-size: 11px;
}

.geom-row:last-child {
    border-bottom: none;
}

.geom-label {
    color: rgba(148, 163, 184, 0.5);
}

.geom-value {
    color: #e2e8f0;
    font-weight: 600;
}

/* ─── Toolbar ─── */
.toolbar-btn {
    padding: 6px 14px;
    background: rgba(30, 30, 60, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ─── Scrollbar ─── */
.mol3d-sidebar::-webkit-scrollbar,
.info-panel::-webkit-scrollbar {
    width: 4px;
}

.mol3d-sidebar::-webkit-scrollbar-thumb,
.info-panel::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.15);
    border-radius: 2px;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .mol3d-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .mol3d-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(99, 102, 241, 0.12);
    }

    .info-panel {
        border-left: none;
        border-top: 1px solid rgba(99, 102, 241, 0.12);
    }
}