@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-color: #0b0c0e;
    --panel-bg: rgba(21, 23, 26, 0.8);
    --text-main: #ffffff;
    --text-muted: #6b7280;
    
    /* Neon Colors */
    --fe-glow: #00ff41;
    --fe-glow-dim: rgba(0, 255, 65, 0.2);
    --neon-blue: #00f0ff;
    --border-color: rgba(255, 255, 255, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    /* Prevent text selection */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Scientific Grid Background */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    padding-bottom: 80px;
}

input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
.tech-text {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sci-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 24px;
    color: var(--text-main);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 1px;
    background: var(--fe-glow);
    box-shadow: 0 0 10px var(--fe-glow);
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 5px;
    letter-spacing: 2px;
}

/* Tabs */
.tab-pane {
    display: none;
    animation: fadeTab 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pane.active {
    display: block;
}

@keyframes fadeTab {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* The Big Element (Status) */
.element-box-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.element-box {
    width: 150px;
    height: 150px;
    background: var(--panel-bg);
    position: relative;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    margin: 0 auto;
}

.element-box.active {
    background: rgba(0, 255, 65, 0.05);
    box-shadow: 0 0 30px var(--fe-glow-dim), inset 0 0 20px var(--fe-glow-dim);
}

.element-box .atomic-num {
    position: absolute;
    top: 10px;
    left: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    color: var(--text-muted);
}

.element-box.active .atomic-num {
    color: var(--fe-glow);
}

.element-box .element-symbol {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 72px;
    line-height: 1;
    color: var(--text-main);
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-top: 10px;
}

.element-box.active .element-symbol {
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.element-box .element-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 5px;
    text-transform: uppercase;
}

.element-box .atomic-mass {
    position: absolute;
    bottom: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    color: var(--text-main);
}

.element-box.active .atomic-mass {
    color: #fff;
    text-shadow: 0 0 10px var(--fe-glow);
}

/* Tariffs Grid */
.elements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.element-card {
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    /* Sci-fi corners */
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.element-card:active {
    transform: scale(0.96);
}

.element-card.selected {
    border-color: var(--fe-glow);
    background: rgba(0, 255, 65, 0.05);
    box-shadow: 0 0 15px var(--fe-glow-dim);
}

.element-card .atomic-num {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.element-card .element-symbol {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 32px;
    margin-top: auto;
    margin-bottom: auto;
    text-align: center;
}

.element-card.selected .element-symbol {
    color: var(--fe-glow);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}

.element-card .element-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.element-card .atomic-mass {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--text-main);
    margin-top: 5px;
}

.element-card.popular {
    border-color: rgba(0, 255, 65, 0.4);
}

.popular-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--fe-glow);
    color: #000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    padding: 4px 12px;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

/* Panels */
.sci-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--fe-glow);
    padding: 20px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.energy-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin: 15px 0;
    /* Inner cut corners */
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* Sci-fi Buttons */
.sci-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    text-transform: uppercase;
}

.sci-btn:not(:disabled):hover,
.sci-btn:not(:disabled):active {
    background: var(--fe-glow-dim);
    border-color: var(--fe-glow);
    color: var(--fe-glow);
}

.sci-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bottom Navigation */
.sci-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(11, 12, 14, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 5px);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    width: 25%;
    padding: 8px 0;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-icon {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    opacity: 0.5;
    transition: all 0.2s;
}

.nav-item span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: var(--fe-glow);
}

.nav-item.active .nav-icon {
    opacity: 1;
    text-shadow: 0 0 10px var(--fe-glow);
    transform: scale(1.1);
}

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 5px;
}

.faq-question {
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.faq-icon {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    color: var(--fe-glow);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--text-muted);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s;
    opacity: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    opacity: 1;
    padding-bottom: 15px;
}


/* CRT Overlay Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    /* Vignette and scanlines */
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
        linear-gradient(90deg, rgba(0, 255, 65, 0.03), rgba(0, 255, 65, 0.01), rgba(0, 255, 65, 0.03));
    background-size: 100% 3px, 3px 100%;
    /* Screen Curvature Vignette */
    box-shadow: inset 0 0 120px rgba(0,0,0,0.9);
}

.crt-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 255, 65, 0.05);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.01; }
    50% { opacity: 0.04; }
    100% { opacity: 0.01; }
}

/* Add a very subtle scan line that moves top to bottom */
.crt-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 40%,
        rgba(0, 255, 65, 0.08) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0)
    );
    background-size: 100% 100%;
    animation: scanline 6s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}


/* FAQ Filters */
.faq-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 15px;
    scrollbar-width: none;
}
.faq-filters::-webkit-scrollbar {
    display: none;
}
.faq-filter-btn {
    min-width: max-content;
    padding: 6px 14px;
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-muted);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.faq-filter-btn.active {
    background: rgba(0,255,65,0.1);
    border-color: var(--fe-glow);
    color: var(--fe-glow);
}
.faq-item.hidden {
    display: none !important;
}


/* Custom hover glow button */
.hover-glow-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--fe-glow);
    filter: brightness(1.2);
}
.hover-glow-btn:active {
    transform: scale(0.98);
}
