/* ===================================
   3D ATOMIC LAB - ATOMIC LAB THEME
   Integrated with Design System
   =================================== */

/* Body styling - matching project theme */
body.atomic-lab-3d {
    font-family: var(--font-secondary);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden; /* Prevent horizontal scrolling */
    min-height: 100vh; /* Allow vertical scrolling while maintaining full height */
    padding-top: var(--space-2xl); /* Space for navbar using design tokens */
    
    /* Quantum Background Pattern - matching homepage */
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(189, 0, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Canvas container - full screen with proper spacing */
/* 3D Lab Container */
.lab-container {
    position: relative; /* Changed from sticky to relative */
    background: linear-gradient(135deg, #0f0f1e, #1a1a2e);
    margin-bottom: 20px;
    min-height: calc(100vh - 100px); /* Full viewport height minus nav */
    display: flex;
    flex-direction: column;
    z-index: 1; /* Low z-index so content can scroll over it */
}

#canvas-container {
    width: 100vw;
    height: calc(70vh - var(--space-xl)); /* Reduced height to leave room for controls */
    position: relative; /* Needed for absolute positioned bonding panels */
    background: transparent; /* Let body background show through */
    flex: 1;
    overflow: visible; /* Allow panels to be visible over canvas */
}

/* Page title - using design system typography */
.title {
    position: relative; /* Changed from fixed to relative */
    margin: var(--space-xl) auto var(--space-lg); /* Center with margins */
    font-family: var(--font-primary); /* Orbitron */
    font-size: var(--font-size-4xl);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* Interaction hint - using design system */
.interaction-hint {
    position: relative; /* Changed from fixed to relative */
    margin: 0 auto var(--space-lg); /* Center with bottom margin */
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    opacity: 0.8;
    transition: opacity var(--duration-normal) var(--ease-out);
    text-align: center;
    font-family: var(--font-mono);
}

.interaction-hint.hidden {
    opacity: 0;
}

/* Controls panel - matching project component style */
.controls {
    position: relative; /* Changed from absolute to relative */
    margin: var(--space-xl) auto 0; /* Center horizontally with top margin */
    
    /* Surface styling matching project */
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-2xl);
    min-width: 800px;
    
    /* Backdrop blur and shadows */
    backdrop-filter: blur(20px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    z-index: var(--z-dropdown);
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
    max-width: 95vw;
}

/* Prevent interaction during drag */
body.dragging .controls {
    pointer-events: none;
}

body.dragging .controls button,
body.dragging .controls input {
    pointer-events: none;
}

/* Element info section */
.element-info {
    text-align: center;
    padding-right: var(--space-xl);
    border-right: 1px solid var(--color-border-secondary);
    min-width: 150px;
    width: 150px;
}

.element-symbol {
    font-family: var(--font-primary); /* Orbitron */
    font-size: var(--font-size-5xl);
    font-weight: var(--font-black);
    margin-bottom: var(--space-xs);
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.element-name {
    font-family: var(--font-secondary);
    font-size: var(--font-size-lg);
    color: var(--color-text-primary); /* Keep original text color */
    margin-bottom: var(--space-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    position: relative;
    
    /* Subtle border to indicate interactivity */
    border: 1px solid transparent;
    background: rgba(0, 212, 255, 0.05);
    
    /* Subtle glow effect matching project style */
    box-shadow: 
        0 0 0 1px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


.element-name:hover {
    color: var(--color-brand-primary);
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--color-brand-primary);
    transform: translateY(-1px);
    
    /* Enhanced glow on hover */
    box-shadow: 
        0 0 0 1px var(--color-brand-primary),
        0 4px 12px rgba(var(--glow-rgb), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}


.atomic-number {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.electron-configuration {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}


/* Particle controls grid */
.particle-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    align-items: start;
    min-width: 400px;
}

.particle-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    min-width: 120px;
}

/* Particle labels with indicators */
.particle-label {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.particle-indicator {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.proton-indicator {
    background: var(--color-error);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

.neutron-indicator {
    background: var(--color-text-secondary);
    box-shadow: 0 0 10px rgba(136, 146, 160, 0.5);
}

.electron-indicator {
    background: var(--color-brand-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Particle adjusters */
.particle-adjuster {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.particle-count {
    font-family: var(--font-mono);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    min-width: 40px;
    text-align: center;
}

/* Buttons - matching project button style */
.btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border-primary);
    background: var(--color-surface-tertiary);
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
    
    /* Subtle glow effect */
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-brand-primary);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--glow-rgb), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:focus {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
}

/* Controls right section */
.controls-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    flex: 1;
}

/* Element selector styling */
.element-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-secondary);
    margin-bottom: var(--space-sm);
}

/* Element navigation container */
.element-navigation {
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

/* Navigation buttons */
.nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border-primary);
    background: var(--color-surface-tertiary);
    color: var(--color-text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
    
    /* Subtle glow effect */
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-brand-primary);
    color: var(--color-brand-primary);
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 12px rgba(var(--glow-rgb), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-surface-secondary);
    border-color: var(--color-border-secondary);
}

.nav-btn:disabled:hover {
    transform: none;
    background: var(--color-surface-secondary);
    border-color: var(--color-border-secondary);
    color: var(--color-text-tertiary);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.selector-label {
    font-family: var(--font-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Searchable select container */
.searchable-select {
    position: relative;
    flex: 1;
}

/* Search input styling */
.element-search {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    width: 100%;
    cursor: text;
    transition: all var(--duration-fast) var(--ease-out);
    
    /* Custom search icon */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300D4FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cpath d='m21 21-4.35-4.35'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--space-xs) center;
    background-size: 12px;
    padding-right: 22px;
}

.element-search::placeholder {
    color: var(--color-text-tertiary);
    font-style: italic;
}

.element-search:hover {
    border-color: var(--color-brand-primary);
    background-color: var(--color-surface-hover);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.3);
}

.element-search:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 
        0 0 0 2px var(--color-brand-primary),
        0 4px 12px rgba(var(--glow-rgb), 0.3);
}

/* Dropdown styling */
.search-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    max-height: 140px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
    
    /* Enhanced styling */
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-dropdown.active {
    animation: dropdownSlideUp 0.2s ease-out;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown option styling */
.search-option {
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-option:last-child {
    border-bottom: none;
}

.search-option:hover,
.search-option.selected {
    background: var(--color-surface-hover);
    color: var(--color-brand-primary);
}

.search-option .element-symbol {
    font-family: var(--font-primary);
    font-weight: var(--font-bold);
    font-size: 11px;
    color: var(--color-brand-primary);
    min-width: 20px;
    text-align: center;
}

.search-option .element-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.search-option .element-name-search {
    font-family: var(--font-secondary);
    font-size: 10px;
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

.search-option .atomic-num {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--color-text-tertiary);
}

.search-option:hover .element-name-search,
.search-option.selected .element-name-search {
    color: var(--color-brand-primary);
}

.search-option:hover .atomic-num,
.search-option.selected .atomic-num {
    color: var(--color-text-secondary);
}

/* Custom scrollbar for dropdown */
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: var(--color-surface-tertiary);
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: var(--color-brand-primary);
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--color-brand-secondary);
}

/* Cinematic functionality removed for simplification */

/* Mode Toggle Styling */
.mode-toggle {
    position: relative; /* Changed from fixed to relative */
    margin: 0 auto var(--space-xl); /* Center with bottom margin */
    display: flex;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    z-index: 200;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-btn {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.mode-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

.mode-btn.active {
    background: var(--color-brand-primary);
    color: var(--color-text-on-brand);
    font-weight: var(--font-bold);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.2);
}

.mode-btn i {
    font-size: var(--font-size-base);
}

/* Side Panels Styling */
.side-panel {
    position: absolute; /* Changed from fixed to absolute within lab-container */
    top: 20px; /* Top of canvas area */
    width: 280px;
    max-height: calc(100% - 120px); /* Leave room for bottom panels */
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.side-panel.active {
    opacity: 1;
    visibility: visible;
}

.left-panel {
    left: 20px; /* Position within canvas container */
}

.right-panel {
    right: 20px; /* Position within canvas container */
}

.panel-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border-secondary);
}

.panel-header h3 {
    margin: 0 0 var(--space-md) 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.element-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--color-surface-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-secondary);
    min-height: 120px; /* Ensure consistent height */
    width: 100%; /* Full width of container */
    max-width: 140px; /* Prevent overflow */
    overflow: hidden; /* Hide any overflow */
    text-align: center;
}

.preview-symbol {
    font-family: var(--font-primary);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-black);
    color: var(--color-brand-primary);
    line-height: 1;
}

.preview-name {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    font-weight: var(--font-medium);
    white-space: nowrap; /* Prevent line breaks */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ... for long names */
    max-width: 100%; /* Ensure it fits container */
}

.preview-electronegativity {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap; /* Prevent line breaks */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ... for long text */
}

.panel-content {
    padding: var(--space-lg);
    max-height: calc(60vh - 140px); /* Restored to original values */
    overflow-y: auto;
}

.element-search-panel {
    width: 100%;
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
}

.element-search-panel:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
}

.element-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
}

.element-grid-item {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    padding: var(--space-xs);
}

.element-grid-item:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.element-grid-item.selected {
    background: var(--color-brand-primary);
    color: var(--color-text-on-brand);
    border-color: var(--color-brand-primary);
    font-weight: var(--font-bold);
    box-shadow: 
        0 0 0 2px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.grid-item-symbol {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-bold);
    line-height: 1;
}

.grid-item-number {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

/* Bonding Information Panel - Center Position */
.bonding-info-panel {
    position: absolute; /* Changed from fixed to absolute */
    top: 600px;
    left: 50%; /* Center within canvas container */
    transform: translateX(-50%);
    width: 300px; /* Slightly smaller for more space */
    height: 180px;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    z-index: 160;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.bonding-panel-content {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.bonding-info-panel.active {
    opacity: 1;
    visibility: visible;
}

.bonding-prediction {
    flex: 1;
    text-align: left; /* Left align in side-by-side layout */
    padding-right: var(--space-md);
    border-right: 1px solid var(--color-border-secondary); /* Vertical divider instead of horizontal */
}

.bond-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-xs); /* Even smaller for compact design */
    color: var(--color-text-secondary);
    line-height: 1.3; /* Tighter line height */
    max-height: 2.6em; /* Limit to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonding-controls {
    display: flex;
    flex-direction: column; /* Column layout for buttons */
    gap: var(--space-xs); /* Smaller gap for vertical layout */
    min-width: 120px; /* Ensure consistent button width */
}

.bond-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content */
    gap: var(--space-xs);
    padding: var(--space-sm); /* Reduced padding for compact column layout */
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    transition: all var(--duration-fast) var(--ease-out);
    width: 100%; /* Full width in column */
    white-space: nowrap;
}

.bond-btn:hover:not(:disabled) {
    background: var(--color-surface-hover);
    border-color: var(--color-brand-primary);
    color: var(--color-brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bond-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bond-btn#form-bond-btn {
    background: linear-gradient(135deg, var(--color-success), var(--color-brand-primary));
    color: var(--color-text-on-brand);
    border-color: var(--color-success);
    font-weight: var(--font-bold);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.1);
}

.bond-btn#form-bond-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-brand-primary), var(--color-success));
    color: var(--color-text-on-brand);
    border-color: var(--color-success);
    font-weight: var(--font-bold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Bonding Mode Visibility */
body.bonding-mode .side-panel.active,
body.bonding-mode .bonding-info-panel.active,
body.bonding-mode .electron-sharing-panel.active {
    opacity: 1;
    visibility: visible;
}

body.bonding-mode .controls {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Adjust spacing when bonding info panel is active */
body.bonding-mode .bonding-info-panel {
    bottom: var(--space-lg); /* Move it up a bit to avoid being too close to bottom */
}

/* Electron Sharing Panel */
.electron-sharing-panel {
    position: absolute; /* Changed from fixed to absolute */
    top: 580px;
    left: 400px;
    width: 300px; /* Slightly smaller for more space */
    height: auto;
    min-height: 180px;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.electron-sharing-panel.active {
    opacity: 1;
    visibility: visible;
}

.sharing-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-secondary);
}

.sharing-header i {
    color: var(--color-brand-primary);
    font-size: var(--font-size-lg);
}

.sharing-header span {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.sharing-type {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-bold);
    color: var(--color-brand-primary);
    margin-bottom: var(--space-sm);
}

.sharing-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
}

.sharing-details {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    background: var(--color-surface-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-brand-primary);
}

/* Show electron sharing panel in bonding mode */
body.bonding-mode .electron-sharing-panel.active {
    opacity: 1;
    visibility: visible;
}

.bond-type {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg); /* Reduced from xl */
    font-weight: var(--font-bold);
    color: var(--color-brand-primary);
    margin-bottom: var(--space-xs); /* Reduced margin */
}

.electronegativity-diff {
    font-family: var(--font-mono);
    font-size: var(--font-size-md); /* Reduced from lg */
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm); /* Reduced margin */
}

.bond-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-xs); /* Even smaller for compact design */
    color: var(--color-text-secondary);
    line-height: 1.3; /* Tighter line height */
    max-height: 2.6em; /* Limit to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonding-controls {
    display: flex;
    flex-direction: column; /* Column layout for buttons */
    gap: var(--space-xs); /* Smaller gap for vertical layout */
    min-width: 120px; /* Ensure consistent button width */
}

.bond-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content */
    gap: var(--space-xs);
    padding: var(--space-sm); /* Reduced padding for compact column layout */
    background: var(--color-surface-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    transition: all var(--duration-fast) var(--ease-out);
    width: 100%; /* Full width in column */
    white-space: nowrap;
}

.bond-btn:hover:not(:disabled) {
    background: var(--color-surface-hover);
    border-color: var(--color-brand-primary);
    color: var(--color-brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bond-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bond-btn#form-bond-btn {
    background: linear-gradient(135deg, var(--color-success), var(--color-brand-primary));
    color: var(--color-text-on-brand);
    border-color: var(--color-success);
    font-weight: var(--font-bold);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.1);
}

.bond-btn#form-bond-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-brand-primary), var(--color-success));
    color: var(--color-text-on-brand);
    border-color: var(--color-success);
    font-weight: var(--font-bold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Electron Configuration Status Panel */
.electron-status-panel {
    position: absolute; /* Changed from fixed to absolute */
    top: 370px;
    right: 450px;
    width: 300px; /* Slightly smaller for more space */
    height: auto;
    min-height: 180px;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(var(--glow-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.electron-status-panel.active {
    opacity: 1;
    visibility: visible;
}

.status-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-secondary);
}

.status-header i {
    color: var(--color-brand-primary);
    font-size: var(--font-size-lg);
}

.status-header span {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

/* Show electron status panel in bonding mode */
body.bonding-mode .electron-status-panel.active {
    opacity: 1;
    visibility: visible;
}

.status-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.atom-status {
    flex: 1;
    text-align: center;
}

.atom-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-bold);
    color: var(--color-brand-primary);
    margin-bottom: var(--space-xs);
}

.electron-count {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.ion-state {
    font-family: var(--font-secondary);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-style: italic;
}

.ion-state.positive {
    color: var(--color-warning);
}

.ion-state.negative {
    color: var(--color-info);
}

.transfer-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand-primary);
    font-size: var(--font-size-lg);
    opacity: 0.7;
    transition: all var(--duration-normal) var(--ease-out);
}

.transfer-arrow.active {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Show electron status panel in bonding mode */
body.bonding-mode .electron-status-panel.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness - following project patterns */
@media (max-width: 768px) {
    body.atomic-lab-3d {
        padding-top: var(--space-xl);
    }
    
    .title {
        font-size: var(--font-size-3xl);
        top: 80px; /* Fixed mobile position below smaller navbar */
    }
    
    .interaction-hint {
        top: 120px; /* Fixed mobile position below title */
        font-size: var(--font-size-xs);
        padding: 0 var(--space-md);
    }
    
    .controls {
        flex-direction: column;
        gap: var(--space-lg);
        bottom: var(--space-md);
        left: var(--space-md);
    }
    
    /* Stack panels vertically on mobile for better visibility */
    .electron-sharing-panel {
        bottom: calc(var(--space-lg) + 400px); /* Stack above other panels */
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 2 * var(--space-lg));
        max-width: 300px;
    }
    
    .bonding-info-panel {
        bottom: calc(var(--space-lg) + 200px); /* Middle position */
        width: calc(100vw - 2 * var(--space-lg));
        max-width: 300px;
    }
    
    .electron-status-panel {
        bottom: var(--space-lg); /* Bottom position */
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 2 * var(--space-lg));
        max-width: 300px;
    }
        right: var(--space-md);
        width: auto;
        transform: none;
        max-width: none;
        padding: var(--space-md);
    }
    
    .element-info {
        border-right: none;
        border-bottom: 1px solid var(--color-border-secondary);
        padding-right: 0;
        padding-bottom: var(--space-md);
        width: 100%;
    }
    
    .particle-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
        width: 100%;
    }
    
    .element-symbol {
        font-size: var(--font-size-4xl);
    }
    
    .particle-count {
        font-size: var(--font-size-lg);
    }
    
    .btn {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .particle-controls {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        text-align: center;
    }
    
    .particle-adjuster {
        justify-content: center;
    }
    
    .title {
        font-size: var(--font-size-2xl);
        padding: 0 var(--space-md);
    }
}

/* Animation effects matching project style */
@keyframes quantum-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Removed pulsing animation from controls panel */

/* Focus states for accessibility */
.btn:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
    border-color: var(--color-brand-primary);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .controls {
        background: var(--color-bg-primary);
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .particle-indicator {
        border: 2px solid currentColor;
    }
}

/* Nuclear Stability Indicator */
.stability-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(0, 255, 127, 0.1);
    border: 2px solid rgba(0, 255, 127, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: help;
}

.stability-indicator i {
    font-size: 1.2em;
}

.stability-indicator.stable {
    background: rgba(0, 255, 127, 0.1);
    border-color: rgba(0, 255, 127, 0.3);
    color: #00ff7f;
    box-shadow: 0 0 10px rgba(0, 255, 127, 0.2);
}

.stability-indicator.warning {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    animation: blink-slow 2s infinite;
}

.stability-indicator.unstable {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.3);
    color: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.2);
    animation: blink-medium 1.5s infinite;
}

.stability-indicator.critical {
    background: rgba(255, 69, 0, 0.1);
    border-color: rgba(255, 69, 0, 0.3);
    color: #ff4500;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.3);
    animation: blink-fast 1s infinite;
}

/* Blinking animations */
@keyframes blink-slow {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes blink-medium {
    0%, 40% { opacity: 1; }
    41%, 100% { opacity: 0.2; }
}

@keyframes blink-fast {
    0%, 30% { opacity: 1; }
    31%, 100% { opacity: 0.1; }
}

.stability-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px currentColor;
}

/* SEO Description Card */
.page-description-card {
    background: linear-gradient(135deg, rgba(15, 15, 30, 0.95), rgba(25, 25, 45, 0.9));
    border: 2px solid rgba(0, 255, 127, 0.2);
    border-radius: 20px;
    margin: 30px auto;
    padding: 40px;
    max-width: 1200px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(0, 255, 127, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    z-index: 10; /* Higher z-index than lab-container */
}

.page-description-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 127, 0.03),
        transparent
    );
    animation: shimmer 8s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.description-content {
    position: relative;
    z-index: 1;
}

.description-title {
    font-size: 2.2em;
    background: linear-gradient(135deg, #00ff7f, #00d4aa, #0099cc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    line-height: 1.2;
}

.description-title i {
    background: linear-gradient(135deg, #00ff7f, #0099cc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s infinite;
}

.description-intro {
    font-size: 1.1em;
    line-height: 1.7;
    color: #e0e6ed;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.feature-item {
    background: linear-gradient(135deg, rgba(0, 255, 127, 0.05), rgba(0, 153, 204, 0.05));
    border: 1px solid rgba(0, 255, 127, 0.15);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 127, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 127, 0.3);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(0, 255, 127, 0.1);
}

.feature-item:hover::before {
    opacity: 1;
}

.feature-item i {
    font-size: 2em;
    color: #00ff7f;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 0 10px rgba(0, 255, 127, 0.3);
}

.feature-item h3 {
    font-size: 1.3em;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
    position: relative;
}

.feature-item p {
    color: #b8c5d1;
    line-height: 1.6;
    font-size: 0.95em;
    position: relative;
}

.description-cta {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 255, 127, 0.1);
}

.cta-text {
    font-size: 1.1em;
    color: #e0e6ed;
    margin-bottom: 25px;
    line-height: 1.6;
}

.cta-button {
    background: linear-gradient(135deg, #00ff7f, #00d4aa);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    color: #0f0f1e;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 5px 15px rgba(0, 255, 127, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 255, 127, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #00ff7f, #00b899);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button i {
    font-size: 1.2em;
}

/* 3D Lab Responsive Design */
@media (max-width: 1024px) {
    .lab-container {
        min-height: calc(100vh - 120px);
    }
    
    #canvas-container {
        height: calc(60vh - var(--space-xl));
    }
}

@media (max-width: 768px) {
    .lab-container {
        min-height: calc(100vh - 80px);
        margin-bottom: 10px;
    }
    
    #canvas-container {
        height: calc(50vh - var(--space-lg));
    }
    
    .controls {
        min-width: unset;
        width: calc(100vw - 40px);
        margin: var(--space-lg) auto 0;
        padding: var(--space-lg);
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-description-card {
        margin: 20px;
        padding: 25px;
    }
    
    .description-title {
        font-size: 1.6em;
        flex-direction: column;
        gap: 10px;
    }
    
    .description-intro {
        font-size: 1em;
        margin-bottom: 30px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .feature-item {
        padding: 20px;
    }
    
    .feature-item i {
        font-size: 1.8em;
    }
    
    .feature-item h3 {
        font-size: 1.2em;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .page-description-card {
        border-radius: 15px;
        margin: 15px;
        padding: 20px;
    }
    
    .description-title {
        font-size: 1.4em;
    }
    
    .features-grid {
        gap: 15px;
    }
    
    .feature-item {
        padding: 15px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .controls {
        animation: none;
    }
    
    .btn {
        transition: none;
    }
    
    .interaction-hint {
        transition: none;
    }
}