:root {
    --bg-color: #f4f4f7;        /* Light gray desk background */
    --paper-bg: #ffffff;        /* Pure white LaTeX paper */
    --text-color: #111111;      /* Dark ink text */
    --border-color: #dddddd;    /* Clean divider color */
    --sidebar-bg: #eef1f6;      /* Clean slate lab console background */
    --panel-border: #ccd1db;
    
    /* Highly saturated Category Colors for glow/highlight */
    --alkali: #e63946;
    --alkaline-earth: #f4a261;
    --transition: #e9c46a;
    --post-transition: #2a9d8f;
    --metalloid: #264653;
    --nonmetal: #457b9d;
    --halogen: #8338ec;
    --noble-gas: #ff006e;
    --lanthanide: #ffb5a7;
    --actinide: #b5e2fa;
    
    --glow-intensity: 10px;
    --cell-width: 25px;   /* Highly compact grid for 50% scale in simulator */
    --cell-height: 30px;
}

/* --- Common Base --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Times New Roman", Times, Georgia, serif;
    margin: 0;
    padding: 0;
}

/* --- Ticker Tape / Oscilloscope (Only on Simulator Page) --- */
#ticker-tape-container {
    background: #09090d;
    border-bottom: 2px solid #000;
    height: 55px;
    display: flex;
    flex-direction: column;
    padding: 3px 15px;
    z-index: 1000;
    font-family: 'Courier New', Courier, monospace;
    flex-shrink: 0;
    color: #00ff00;
}

.ticker-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.ticker-label {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#ticker-status {
    font-size: 10px;
    color: #88cc88;
}

#ticker-tape {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    gap: 1px;
}

.bit {
    width: 2px;
    background: #00ff00;
    transition: height 0.05s ease;
}
.bit.high-long { height: 85%; box-shadow: 0 0 4px #00ff00; }
.bit.high-short { height: 25%; background: #00aa00; }
.bit.low { height: 0%; background: transparent; width: 4px; }

/* --- PROPOSAL PAGE (index.html) --- */
.proposal-body {
    background-color: #f0f0f2;
    overflow-y: auto;
    padding: 40px 0;
}

.centered-paper {
    background-color: var(--paper-bg);
    max-width: 820px; /* True A4-like proportional width */
    margin: 0 auto;
    padding: 70px 80px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    text-align: justify;
    line-height: 1.65;
}

.paper-header {
    text-align: center;
    margin-bottom: 35px;
    font-family: "Times New Roman", Times, Georgia, serif;
}

.paper-header .institution {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.paper-header .department {
    font-size: 0.95rem;
    color: #444;
}

.paper-header .document-type {
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-top: 15px;
    font-weight: bold;
    color: #444;
    border-top: 1px solid #111;
    border-bottom: 1px solid #111;
    padding: 6px 0;
    display: inline-block;
}

.paper-header .date {
    font-size: 0.9rem;
    margin-top: 10px;
    color: #555;
}

.proposal-title {
    font-size: 2.1rem;
    font-weight: normal;
    text-align: center;
    margin: 30px 0;
    line-height: 1.25;
}

.authors {
    text-align: center;
    margin-bottom: 35px;
    font-size: 1rem;
}

.author-title {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}

/* Simulator Callout Box with Launch Link */
.simulator-callout {
    background: #f7f9fc;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 20px;
    margin: 30px 0;
    text-align: center;
    font-family: sans-serif;
}

.simulator-callout p {
    text-indent: 0;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #24292f;
    line-height: 1.5;
}

.launch-btn {
    display: inline-block;
    background: #0f4c75;
    color: #fff !important;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 6px rgba(15,76,117,0.3);
    transition: all 0.2s;
}

.launch-btn:hover {
    background: #1b4965;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(15,76,117,0.4);
}

.abstract {
    margin: 0 40px 40px 40px;
    font-size: 0.95rem;
    line-height: 1.55;
    background: #fcfcfc;
    border: 1px dashed #bbb;
    padding: 20px;
}

.section-divider {
    border: 0;
    border-top: 1px solid #111;
    margin: 35px 0;
}

h2 {
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 35px;
    border-bottom: 1px solid #222;
    padding-bottom: 3px;
}

p {
    text-indent: 25px;
    margin: 0 0 15px 0;
}

/* Historical Accordion inside Proposal */
.accordion-container {
    margin: 25px 0;
}

.accordion-trigger {
    width: 100%;
    background: #f1f3f5;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 12px;
    text-align: left;
    font-family: sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.accordion-trigger:hover {
    background: #e9ecef;
}

.accordion-content {
    display: none;
    border: 1px solid #ced4da;
    border-top: none;
    padding: 20px;
    background: #fdfdfd;
    max-height: 400px;
    overflow-y: auto;
}

.email-thread {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.email-thread:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.email-thread h4 {
    margin: 0 0 5px 0;
    font-family: sans-serif;
    font-size: 0.95rem;
    color: #0f4c75;
}

.email-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 10px;
    text-indent: 0;
}

.email-body {
    font-style: italic;
    font-size: 0.9rem;
    color: #495057;
    margin: 0;
    border-left: 3px solid #ced4da;
    padding-left: 15px;
}

/* Academic Figures */
.figure-container {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.figure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.figure-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #dee2e6;
    padding: 8px;
    background: #fafafa;
}

.figure-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.caption {
    font-size: 0.8rem;
    font-style: italic;
    color: #495057;
    margin-top: 8px;
    text-align: center;
    line-height: 1.35;
    font-family: sans-serif;
}

.media-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.media-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #dee2e6;
    padding: 8px;
    background: #fafafa;
}

/* Force equal heights on the concept image and video */
.aligned-media {
    height: 220px !important;
    width: 100%;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.text-center {
    text-align: center;
}

.single-fig {
    width: 70%;
}

.gold-image {
    max-height: 220px;
    display: block;
    margin: 0 auto;
}

/* Callout Box and Card Comparison */
.academic-callout {
    background: #f8f9fa;
    border-left: 4px solid #0f4c75;
    padding: 20px;
    margin: 30px 0;
}

.academic-callout h3 {
    margin-top: 0;
    font-size: 1.05rem;
    font-family: sans-serif;
    color: #212529;
}

.description-compare {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.desc-box {
    flex: 1;
    padding: 15px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.old-desc {
    background: #fdf2f2;
    border: 1px solid #fde2e2;
    color: #721c24;
}

.new-desc {
    background: #f2f9f3;
    border: 1px solid #e1f4e5;
    color: #155724;
}

.nugget-note {
    font-size: 0.75rem;
    margin-top: 10px;
    border-top: 1px dashed #d1e7dd;
    padding-top: 8px;
    text-indent: 0;
    color: #555;
    font-style: italic;
}

/* --- STANDALONE SIMULATOR PAGE (simulator.html) --- */
.simulator-body {
    background-color: #0f0f14;
    color: #e0e0e3;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.simulator-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 310px;
    background: #14141d;
    border-right: 1px solid #25252e;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.4);
    z-index: 10;
}

.sidebar h2 {
    font-family: sans-serif;
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
    border-bottom: none;
    padding: 0;
}

.sidebar h3 {
    font-family: sans-serif;
    font-size: 0.85rem;
    color: #a0a0ab;
    border-bottom: 1px solid #2a2a35;
    padding-bottom: 3px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#detail-panel {
    background: #1e1e28;
    border: 1px solid #2e2e3d;
    border-radius: 6px;
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    font-family: sans-serif;
}

.detail-placeholder {
    color: #666;
    font-style: italic;
    font-size: 0.85rem;
}

#detail-panel h2 { margin: 0; font-size: 2.8rem; line-height: 1; font-family: "Times New Roman", serif; font-weight: bold; color: #fff;}
#detail-panel h3 { margin: 5px 0 3px 0; font-size: 1.1rem; font-weight: bold; color: #fff;}
#detail-panel p { margin: 0; font-size: 0.75rem; color: #bbb; }

.controls-section {
    margin-top: 5px;
}

.simulator-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Standalone Simulator Category Grid */
.table-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle at center, #1b1b24 0%, #0a0a0f 100%);
}

#periodic-table {
    display: grid;
    grid-template-columns: repeat(18, var(--cell-width));
    grid-template-rows: repeat(10, var(--cell-height));
    gap: 3px;
}

.element-box {
    background-color: #1e1e28;
    border: 1px solid #2e2e3d;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1px;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, opacity 0.2s, background-color 0.3s;
    position: relative;
    user-select: none;
}

.element-box:hover {
    transform: scale(1.6);
    z-index: 100;
    background-color: #2e2e3d;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.element-box .number { position: absolute; top: 1px; left: 2px; font-size: 5px; color: #888; }
.element-box .symbol { font-size: 11px; font-weight: bold; margin-top: 3px; color: #fff; }
.element-box .name { font-size: 4px; color: #bbb; text-transform: uppercase; margin-top: 1px; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Category Glow styles */
.element-box.alkali:hover, .element-box.alkali.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--alkali); border-color: var(--alkali); }
.element-box.alkaline-earth:hover, .element-box.alkaline-earth.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--alkaline-earth); border-color: var(--alkaline-earth); }
.element-box.transition:hover, .element-box.transition.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--transition); border-color: var(--transition); }
.element-box.noble-gas:hover, .element-box.noble-gas.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--noble-gas); border-color: var(--noble-gas); }
.element-box.nonmetal:hover, .element-box.nonmetal.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--nonmetal); border-color: var(--nonmetal); }
.element-box.halogen:hover, .element-box.halogen.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--halogen); border-color: var(--halogen); }
.element-box.lanthanide:hover, .element-box.lanthanide.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--lanthanide); border-color: var(--lanthanide); }
.element-box.actinide:hover, .element-box.actinide.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--actinide); border-color: var(--actinide); }
.element-box.metalloid:hover, .element-box.metalloid.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--metalloid); border-color: var(--metalloid); }
.element-box.post-transition:hover, .element-box.post-transition.highlighted { box-shadow: 0 0 var(--glow-intensity) var(--post-transition); border-color: var(--post-transition); }

.element-box.dimmed {
    opacity: 0.15;
    filter: grayscale(1);
    pointer-events: none;
}

/* Button style adjustments inside simulator side panel */
.sidebar .filter-btn {
    background: #1e1e28;
    border: 1px solid #2e2e3d;
    color: #bbb;
    padding: 6px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: sans-serif;
    flex-grow: 1;
    text-align: center;
}

.sidebar .filter-btn:hover { background: #2a2a35; color: #fff; }
.sidebar .filter-btn.active { background: #0f4c75; color: #fff; border-color: #0f4c75; box-shadow: 0 2px 5px rgba(15,76,117,0.4); }

.sidebar .action-btns {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar .action-btns button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-family: sans-serif;
    transition: all 0.2s;
}

.sidebar .primary-btn { background: #0f4c75; color: #fff; }
.sidebar .primary-btn:hover { background: #1b4965; }

.sidebar .secondary-btn { background: #2a2a35; color: #ccc; border: 1px solid #3e3e4f !important; }
.sidebar .secondary-btn:hover { background: #353545; color: #fff; }
