/* === Theme Variables — provided by explorer-theme-bridge.css === */

/* === Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.5s ease, color 0.5s ease;
}

#container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* === Title === */
#title {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--accent);
    z-index: 100;
    text-transform: uppercase;
}

/* === Menu Buttons === */
#menu {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

#menu button {
    padding: 10px 24px;
    border: 1px solid var(--card-border);
    background: var(--btn-bg);
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#menu button:hover {
    background: rgba(127, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-dim);
}

#menu button.active {
    background: rgba(127, 255, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-dim);
}

/* === Element Cards === */
.element {
    width: 120px;
    height: 140px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-shadow: 0 4px 15px var(--shadow);
    position: relative;
}

.element:hover {
    border-color: var(--accent);
    background: var(--card-hover-bg);
    box-shadow: 0 0 30px var(--accent-dim), 0 8px 25px var(--shadow);
}

.element .number {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: var(--accent-dim);
}

.element .symbol {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 0 10px var(--accent-dim);
}

.element .name {
    font-size: 11px;
    color: var(--text);
    opacity: 0.7;
    margin-top: 4px;
}

.element .mass {
    font-size: 10px;
    color: var(--accent-dim);
    margin-top: 2px;
}

/* === Detail Panel === */
#detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 380px;
    height: 100%;
    background: var(--panel-bg);
    border-right: 1px solid var(--card-border);
    z-index: 150;
    display: none;
    flex-direction: column;
    padding: 60px 30px 30px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    box-shadow: 5px 0 40px var(--shadow);
}

#detail-panel.visible {
    display: flex;
}

#detail-panel .detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(127, 255, 255, 0.4);
    background: transparent;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#detail-panel .detail-close:hover {
    background: rgba(127, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(127, 255, 255, 0.3);
}

#detail-panel .detail-symbol {
    font-size: 80px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 0 30px var(--accent-dim);
    margin-bottom: 5px;
}

#detail-panel .detail-name {
    font-size: 28px;
    font-weight: 300;
    color: var(--text);
    opacity: 0.9;
    margin-bottom: 5px;
}

#detail-panel .detail-number {
    font-size: 14px;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 30px;
}

#detail-panel .detail-section {
    margin-bottom: 20px;
}

#detail-panel .detail-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-dim);
    margin-bottom: 8px;
}

#detail-panel .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}

#detail-panel .detail-row .label {
    color: var(--text);
    opacity: 0.5;
    font-size: 13px;
}

#detail-panel .detail-row .value {
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

/* === Atom Viewer === */
#atom-viewer-section {
    margin-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#atom-viewer-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-dim);
    margin-bottom: 10px;
}

#atom-viewer-container {
    flex: 1;
    min-height: 200px;
    max-height: 320px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    cursor: grab;
}

#atom-viewer-container:active {
    cursor: grabbing;
}

#atom-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.atom-hint {
    font-size: 10px;
    color: var(--accent-dim);
    text-align: center;
    margin-top: 6px;
    opacity: 0.6;
}

/* === Axis Controls === */
#axis-controls {
    position: absolute;
    bottom: 90px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#axis-controls .axis-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--card-border);
    background: var(--btn-bg);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#axis-controls .axis-btn:hover {
    background: rgba(127, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
}

#axis-controls .axis-btn.reset-btn {
    width: 50px;
    height: 50px;
    font-size: 12px;
    border-color: var(--accent-dim);
    margin-bottom: 8px;
}

#axis-controls .axis-btn.reset-btn:hover {
    box-shadow: 0 0 20px var(--accent-dim);
}

#axis-controls .axis-row {
    display: flex;
    gap: 6px;
}

/* === Theme Toggle === */
#theme-toggle {
    position: absolute;
    top: 68px;
    right: 20px;
    z-index: 100;
    width: 42px;
    height: 42px;
    border: 1px solid var(--card-border);
    background: var(--btn-bg);
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
}

/* === Error === */
#error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff4444;
    font-size: 16px;
    z-index: 200;
    display: none;
    text-align: center;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
}