/* MOL-GOD Atomic Visualizer — Breaking Bad Style */

/* Breaking Bad Font — Heart Breaking Bad (CC BY 4.0, Chequered Ink) */
@font-face {
    font-family: 'BreakingBad';
    src: url('../fonts/breaking-bad.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bb-font: 'BreakingBad', 'Impact', 'Arial Black', sans-serif;
    --bb-green: #00FF41;
    --bb-dark: #0A0E27;
    --bb-card: #1A1E37;
    --bb-glow: rgba(0, 255, 65, 0.6);
}

.molgod-atom-wrap {
    background: linear-gradient(135deg, #0A0E27 0%, #1A1E37 100%);
    border: 2px solid #00FF41;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    margin: 16px 0;
    position: relative;
}

.molgod-atom-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.molgod-atom-symbol {
    font-family: var(--bb-font);
    font-size: 72px;
    font-weight: 900;
    color: #FFFFFF;
    background: var(--bb-green);
    padding: 4px 16px;
    border-radius: 6px;
    line-height: 1.1;
    margin-right: 20px;
    box-shadow: 0 0 20px var(--bb-glow);
    text-shadow: none;
    display: inline-block;
}

.molgod-atom-info { flex: 1; }

.molgod-atom-name {
    font-family: var(--bb-font);
    font-size: 28px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.molgod-atom-name-pl {
    font-size: 14px;
    color: #00FF41;
    opacity: 0.8;
    margin-top: 2px;
}

.molgod-atom-number {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #00FF41;
    margin-top: 4px;
}

.molgod-atom-canvas {
    width: 100%;
    display: block;
    cursor: grab;
}
.molgod-atom-canvas:active { cursor: grabbing; }

/* Info Panel */
.molgod-atom-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
}

.molgod-atom-stat {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
}

.molgod-atom-stat-label {
    font-size: 9px;
    color: #00FF41;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.molgod-atom-stat-value {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
}

/* Nucleus info */
.molgod-atom-nucleus {
    padding: 12px 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 255, 65, 0.1);
}

.molgod-particle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #ccc;
}

.molgod-particle-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.molgod-particle-dot.proton { background: #E74C3C; box-shadow: 0 0 6px #E74C3C; }
.molgod-particle-dot.neutron { background: #3498DB; box-shadow: 0 0 6px #3498DB; }

/* Shell legend */
.molgod-atom-shells {
    padding: 12px 24px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.molgod-shell-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.molgod-shell-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Electron config */
/* ═══ WIDGET INFO PANEL — Breaking Bad override for elements ═══ */

.molgod-widget .molgod-info-title,
.molgod-widget .molgod-compound-name,
.molgod-widget h2,
.molgod-widget h3 {
    font-family: var(--bb-font) !important;
}

/* Green glow for element symbol in widget */
.molgod-widget .molgod-info-cas,
.molgod-widget .molgod-info-formula {
    color: var(--bb-green) !important;
    text-shadow: 0 0 8px var(--bb-glow) !important;
    font-family: var(--bb-font) !important;
}

/* Element badge in widget header */
.molgod-widget .molgod-verified-badge {
    background: var(--bb-green) !important;
    color: #000 !important;
    font-family: var(--bb-font) !important;
    box-shadow: 0 0 10px var(--bb-glow) !important;
}

/* ═══ PERIODIC TABLE ═══ */

.molgod-ptable {
    background: var(--bb-dark);
    padding: 8px;
    border-radius: 8px;
    overflow-x: auto;
}

.molgod-ptable-row {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.molgod-ptable-spacer {
    height: 6px;
}

.molgod-ptable-cell {
    width: 44px;
    height: 48px;
    background: var(--bb-card);
    border: 1.5px solid #333;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.molgod-ptable-cell:hover {
    transform: scale(1.3);
    z-index: 10;
    border-color: var(--bb-green);
    box-shadow: 0 0 12px var(--bb-glow);
}

.molgod-ptable-cell.empty {
    background: transparent;
    border: none;
    cursor: default;
}
.molgod-ptable-cell.empty:hover {
    transform: none;
    box-shadow: none;
}

.ptc-z {
    font-size: 7px;
    color: #888;
    position: absolute;
    top: 2px;
    left: 3px;
}

.ptc-s {
    font-family: var(--bb-font);
    font-size: 18px;
    color: var(--bb-green);
    text-shadow: 0 0 6px rgba(0,255,65,0.4);
    line-height: 1;
}

.ptc-n {
    font-size: 5.5px;
    color: #aaa;
    max-width: 42px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Miniature table trigger */
.molgod-ptable-mini {
    display: inline-block;
    background: var(--bb-dark);
    border: 2px solid var(--bb-green);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0,255,65,0.2);
}

.molgod-ptable-mini:hover {
    box-shadow: 0 0 20px var(--bb-glow);
    transform: scale(1.05);
}

.molgod-ptable-mini-label {
    font-family: var(--bb-font);
    font-size: 14px;
    color: var(--bb-green);
    text-shadow: 0 0 8px rgba(0,255,65,0.5);
}

/* ═══ END PERIODIC TABLE ═══ */

.molgod-atom-config {
    padding: 8px 24px 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00FF41;
    background: rgba(0, 255, 65, 0.03);
    border-top: 1px solid rgba(0, 255, 65, 0.1);
}

/* ═══ FULLSCREEN OVERLAY ═══ */

.molgod-atom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow-y: auto;
    animation: molgod-fadeIn 0.3s ease;
    display: none;
}

@keyframes molgod-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.molgod-atom-overlay .overlay-view {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.molgod-atom-overlay .overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(0, 255, 65, 0.3);
}

.molgod-atom-overlay .overlay-header h2 {
    margin: 0;
    font-family: var(--bb-font);
    font-size: 24px;
    color: #fff;
}

.molgod-atom-overlay .overlay-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.5);
    color: #00FF41;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.molgod-atom-overlay .overlay-btn:hover {
    background: #00FF41;
    color: #000;
    box-shadow: 0 4px 16px rgba(0, 255, 65, 0.4);
}

.molgod-atom-overlay .atom-canvas-fullscreen {
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
}

/* Overlay periodic table (larger for fullscreen) */
.molgod-atom-overlay .molgod-ptable-cell {
    width: 56px;
    height: 60px;
}

.molgod-atom-overlay .ptc-s {
    font-size: 22px;
}

.molgod-atom-overlay .ptc-n {
    font-size: 7px;
    display: block;
}

/* ═══ CONTROLS BAR ═══ */

.molgod-atom-controls button {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.molgod-atom-controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ═══ RESPONSIVE OVERLAY ═══ */

@media (max-width: 768px) {
    .molgod-atom-overlay .overlay-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .molgod-atom-overlay .overlay-header h2 {
        font-size: 18px;
    }

    .molgod-atom-overlay .molgod-ptable-cell {
        width: 32px;
        height: 36px;
    }

    .molgod-atom-overlay .ptc-s {
        font-size: 14px;
    }

    .molgod-atom-overlay .ptc-n {
        display: none;
    }

    .molgod-atom-overlay .atom-canvas-fullscreen {
        height: calc(100vh - 100px);
        min-height: 350px;
    }

    .molgod-atom-controls {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 480px) {
    .molgod-atom-overlay .molgod-ptable-cell {
        width: 20px;
        height: 24px;
    }

    .molgod-atom-overlay .ptc-s {
        font-size: 10px;
    }
}

@media print {
    .molgod-atom-overlay { display: none !important; }
}
