@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #000000;
    --panel-bg: #111111;
    --panel-border: #333333;
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --accent: #0070f3;
    --accent-hover: #3291ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
    line-height: 1.5;
}

.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 24px;
    min-width: 0;
}

.title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.input-grid {
    display: grid;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: bold;
}

input {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
}

.btn-primary:hover {
    background: #cccccc;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.badge {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.section {
    margin-bottom: 32px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    overflow-x: auto;
}

.section-title {
    padding: 16px 24px;
    color: var(--accent);
    background: rgba(0, 112, 243, 0.05);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 24px;
    background: #171717;
    color: #ededed;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid var(--panel-border);
    white-space: nowrap;
}

td {
    padding: 12px 24px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--panel-border);
    font-size: 14px;
    white-space: nowrap;
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.note {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 16px;
    background: var(--panel-bg);
    border-radius: 6px;
    border: 1px solid var(--panel-border);
}

.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    padding: 24px 32px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    z-index: 9999;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.sweep-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--panel-border);
}
.sweep-row:last-child {
    border-bottom: none;
}
.sweep-label {
    width: 200px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}
.sweep-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 140px;
}
.sweep-inputs {
    display: flex;
    gap: 16px;
    flex: 1;
}
.sweep-inputs .field {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.sweep-inputs input {
    padding: 8px 12px;
    width: 100px;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    padding: 16px;
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}
.chart-container:fullscreen {
    background: var(--bg-color);
    padding: 40px;
}
.chart-container:-webkit-full-screen {
    background: var(--bg-color);
    padding: 40px;
}
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    z-index: 10;
    font-size: 12px;
}
.fullscreen-btn:hover {
    background: #333333;
}
.chart-container:fullscreen .fullscreen-btn { top: 20px; right: 20px; }
.chart-container:-webkit-full-screen .fullscreen-btn { top: 20px; right: 20px; }

.sys-warning, .sys-section, .sys-section-title, .sys-row, .sys-label-container, .sys-badge, .sys-label, .sys-value-container, .sys-fx, .sys-sheet-badge, .sys-sheets {
    display: none; 
}

.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-box {
    background: var(--panel-bg);
    padding: 32px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    width: 400px;
}
.auth-title {
    font-size: 24px; 
    font-weight: 600; 
    margin-bottom: 24px; 
    text-align: center;
    color: var(--text-primary);
}
.auth-message {
    margin-bottom: 16px; font-size: 13px; text-align: center; padding: 12px; border-radius: 6px;
    display: none; font-weight: 500;
}
.auth-message.error {
    background: rgba(255,0,0,0.1); border: 1px solid rgba(255,0,0,0.2); color: #ff3333;
}
.auth-message.success {
    background: rgba(0,255,0,0.1); border: 1px solid rgba(0,255,0,0.2); color: #33ff33;
}
.auth-message.warning {
    background: rgba(255,165,0,0.1); border: 1px solid rgba(255,165,0,0.2); color: #ffa500;
}
.topbar {
    display: flex; justify-content: flex-end; gap: 16px; margin-bottom: 20px;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1000px;
    margin: 40px auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.dashboard-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.dashboard-card h3 {
    font-size: 24px;
    margin: 20px 0 10px;
    color: #fff;
}

.dashboard-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.card-icon {
    font-size: 64px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

/* Hybrid LCOS Animations */
.hybrid-card:hover .sun-anim {
    animation: sun-pulse 2s infinite alternate;
}
.hybrid-card:hover .rays-anim {
    animation: rays-spin 3s linear infinite;
    opacity: 1;
}
.sun-anim {
    position: relative;
    z-index: 2;
    transition: transform 0.3s;
}
.rays-anim {
    position: absolute;
    font-size: 40px;
    color: #fcd34d;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

@keyframes sun-pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(252, 211, 77, 0.5)); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(252, 211, 77, 1)); }
}
@keyframes rays-spin {
    0% { transform: rotate(0deg) scale(1.5); }
    100% { transform: rotate(360deg) scale(1.5); }
}

/* Steam Simulator Animations */
.steam-card:hover .gear-anim-large {
    animation: gear-spin 4s linear infinite;
}
.steam-card:hover .steam-anim {
    animation: steam-float 2s infinite ease-in-out;
}
.gear-anim-large {
    position: absolute;
    font-size: 50px;
    bottom: 5px;
    right: 30%;
    z-index: 2;
    transition: transform 0.3s;
}
.steam-anim {
    position: relative;
    z-index: 1;
    transform-origin: bottom;
    display: inline-block;
}

@keyframes gear-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes steam-float {
    0% { transform: translateY(0) scale(1); opacity: 0.8; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); }
    50% { transform: translateY(-15px) scale(1.1); opacity: 1; filter: drop-shadow(0 0 15px rgba(255,255,255,0.5)); }
    100% { transform: translateY(-30px) scale(1.2); opacity: 0; filter: drop-shadow(0 0 5px rgba(255,255,255,0)); }
}

/* Hybrid Expansion Animations */
.expansion-card:hover span:nth-child(1) {
    animation: sun-pulse 2s infinite alternate;
}
.expansion-card:hover span:nth-child(2) {
    animation: gear-spin 3s linear infinite reverse;
}
.expansion-card:hover span:nth-child(3) {
    animation: steam-float 3s infinite ease-in-out;
}

/* Background glows on cards */
.hybrid-card::before, .steam-card::before, .expansion-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.hybrid-card:hover::before, .steam-card:hover::before, .expansion-card:hover::before {
    opacity: 1;
}

/* Project-Related Floating Background Animation */
#dashboard-tab {
    background: linear-gradient(135deg, #0f172a 0%, #050505 100%);
}

/* Construction and Analysis Background Scene */
.scene-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 350px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.25; /* Keep it subtle in the background */
    border-bottom: 10px solid #1f2937;
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.8));
    overflow: hidden;
}

/* Powerplant */
.powerplant {
    position: absolute;
    bottom: 10px;
    left: 10%;
    font-size: 160px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)) grayscale(0.5);
}
.smoke-clouds span {
    position: absolute;
    bottom: 150px;
    left: 18%;
    font-size: 40px;
    opacity: 0;
    animation: smoke-rise 4s infinite linear;
    filter: grayscale(1);
}

/* Crane */
.crane-container {
    position: absolute;
    bottom: 10px;
    left: 28%;
    animation: crane-pan 12s infinite alternate ease-in-out;
}
.crane {
    font-size: 200px;
    line-height: 1;
    transform: scaleX(-1);
    filter: grayscale(0.4);
}
.crane-hook {
    position: absolute;
    top: 55px;
    left: -20px;
    text-align: center;
    animation: hook-drop 6s infinite alternate ease-in-out;
}
.chain { font-size: 20px; line-height: 0.8; }
.hook-load { font-size: 30px; margin-top: -5px; }

/* Workers */
.worker {
    position: absolute;
    bottom: 10px;
    font-size: 40px;
}
.builder-1 {
    left: 45%;
}
.hammer-anim {
    display: inline-block;
    transform-origin: bottom left;
    animation: scene-hammer 0.5s infinite alternate;
}
.welder-1 {
    left: 28%;
}
.weld-spark {
    position: absolute;
    top: 10px;
    left: -10px;
    font-size: 20px;
    animation: scene-weld 1s infinite alternate;
}
.truck {
    position: absolute;
    bottom: 10px;
    left: -100px;
    font-size: 50px;
    animation: drive-truck 20s infinite linear;
    filter: grayscale(0.5);
}

/* Analyst Station */
.analyst-station {
    position: absolute;
    bottom: 10px;
    right: 10%;
    display: flex;
    align-items: flex-end;
    background: rgba(255,255,255,0.05);
    padding: 15px 25px;
    border-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
}
.screens {
    font-size: 35px;
    line-height: 1.1;
    margin-right: 15px;
    animation: screens-flicker 2s infinite alternate;
}
.analyst {
    font-size: 50px;
    animation: scene-typing 0.2s infinite alternate;
}
.analyst-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    color: #38bdf8;
    white-space: nowrap;
    letter-spacing: 1px;
    animation: screens-flicker 2s infinite alternate;
}

/* Keyframes */
@keyframes smoke-rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    100% { transform: translateY(-120px) scale(2.5); opacity: 0; }
}
@keyframes crane-pan {
    0% { transform: translateX(0); }
    100% { transform: translateX(120px); }
}
@keyframes hook-drop {
    0% { transform: translateY(0); }
    100% { transform: translateY(80px); }
}
@keyframes drive-truck {
    0% { transform: translateX(-200px); }
    100% { transform: translateX(120vw); }
}
@keyframes scene-hammer {
    from { transform: rotate(-20deg); }
    to { transform: rotate(20deg); }
}
@keyframes scene-weld {
    0%, 40% { opacity: 0; transform: scale(0.5); filter: drop-shadow(0 0 0px yellow); }
    50% { opacity: 1; transform: scale(1.5); filter: drop-shadow(0 0 10px yellow); }
    60%, 100% { opacity: 0; transform: scale(0.5); filter: drop-shadow(0 0 0px yellow); }
}
@keyframes screens-flicker {
    0% { filter: brightness(1) drop-shadow(0 0 2px rgba(56, 189, 248, 0.3)); }
    100% { filter: brightness(1.2) drop-shadow(0 0 10px rgba(56, 189, 248, 0.8)); }
}
@keyframes scene-typing {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
}/* React Translation CSS */
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.ping-anim {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes streamMove {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(120vw); }
}
.data-stream-track {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: rgba(30, 41, 59, 0.5);
}
.data-stream-particle {
    width: 96px;
    height: 2px;
    background: linear-gradient(to right, transparent, #22d3ee, transparent);
    box-shadow: 0 0 8px #22d3ee;
    animation: streamMove linear infinite;
}

/* Custom Premium Inputs for CUF Target Optimizer Studio */
.opt-panel-input {
    background: rgba(15, 23, 42, 0.45) !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    color: #f8fafc !important;
    font-size: 13px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
}

.opt-panel-input:hover {
    border-color: rgba(56, 189, 248, 0.35) !important;
    background: rgba(15, 23, 42, 0.6) !important;
}

.opt-panel-input:focus {
    outline: none !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

.opt-panel-label {
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: #94a3b8 !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    display: block !important;
}

