:root {
    --bg-dark: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --text-main: #0f172a;
    --text-muted: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, transparent 70%);
}

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    height: 80px; padding: 0 50px; background: transparent;
    border-bottom: 1px solid var(--glass-border); z-index: 10;
}
.logo { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--text-muted); font-weight: 300; }
.lang-switcher select {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.lang-switcher select:hover {
    background: rgba(255, 255, 255, 0.9);
}
.status-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 18px; border-radius: 30px;
    border: 1px solid var(--glass-border); font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.03);
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.green { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,0.4); }

/* View Switching - Premium UI Feel */
.view-container {
    position: absolute; top: 80px; left: 0; right: 0; bottom: 10px;
    display: flex; flex-direction: column; opacity: 0; pointer-events: none;
    overflow-y: auto; /* Allow scrolling when content overflows on small screens */
    /* Subtle scale and slight Y translation for depth */
    transform: scale(0.97) translateY(10px);
    /* High-end cubic-bezier (fast snap, slow settle) similar to Apple/macOS */
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    filter: blur(4px);
}
.view-container.active { 
    opacity: 1; 
    pointer-events: all; 
    transform: scale(1) translateY(0); 
    filter: blur(0px);
}

/* Panels */
.panel {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}
.panel-header {
    padding: 15px 20px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border); text-transform: uppercase; letter-spacing: 1px;
    background: rgba(255,255,255,0.4);
}

/* Buttons & Inputs */
.btn {
    padding: 12px 24px; border-radius: 8px; border: none; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(37,99,235,0.2); }
.btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-secondary { background: rgba(0, 0, 0, 0.05); color: var(--text-main); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.1); }
.massive-btn { font-size: 1.2rem; padding: 20px; width: 100%; border-radius: 12px; margin-top: auto; }
.text-input {
    width: 100%; padding: 12px 15px; border-radius: 8px;
    border: 1px solid var(--glass-border); background: #ffffff;
    color: var(--text-main); font-size: 1rem;
}
.drop-zone {
    width: 100%; padding: 50px 20px; min-height: 160px;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed rgba(0,0,0,0.2);
    border-radius: 8px; text-align: center; color: var(--text-muted);
    cursor: pointer; transition: 0.3s; background: rgba(255,255,255,0.5);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: #ffffff; color: var(--primary); }

/* Editor View Specifics */
.editor-main { flex: 1; display: flex; padding: 15px 50px; gap: 30px; }
.left-panel { flex: 2; }
.ketcher-frame { width: 100%; flex: 1; border: none; background: white; }
.right-panel { flex: 1; padding: 0; display: flex; flex-direction: column; }
.tools-container { padding: 40px; display: flex; flex-direction: column; gap: 30px; flex: 1; }
.input-group label { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }
.input-group { display: flex; flex-direction: column; gap: 10px; }

/* Results View Specifics */
.results-header { display: flex; align-items: center; gap: 20px; padding: 15px 50px 0; }
.results-header h2 { font-weight: 600; letter-spacing: 1px; color: var(--text-main); }
.results-main { flex: 1; display: flex; padding: 15px 50px; gap: 25px; min-height: 0; }
.results-left { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.viewer-container { flex: 1; position: relative; min-height: 0; background: #ffffff; border-radius: 12px; }
.results-right { flex: 1; display: flex; flex-direction: column; gap: 15px; background: transparent; border: none; box-shadow: none; min-height: 0; }

/* Dashboard Cards */
.highlight-card, .chart-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 20px 25px; box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}
.card-title { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.energy-display { display: flex; align-items: baseline; gap: 10px; }
.energy-display .value { font-size: 4rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--primary); }
.energy-display .unit { font-size: 1.5rem; font-weight: 600; color: var(--text-muted); }
.wavelength-display { margin-top: 5px; font-size: 1.1rem; color: var(--text-muted); }
.highlight-text { color: var(--accent); font-weight: 800; font-size: 1.3rem; }
.chart-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chart-container { flex: 1; position: relative; width: 100%; min-height: 0; }

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: var(--bg-dark);
}

.loading-screen h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 20px 0 10px 0;
    letter-spacing: -0.5px;
}

.loading-screen p {
    font-size: 1rem;
    color: var(--text-muted);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spectrum Bar */
.spectrum-bar-container { margin-top: 15px; }
.spectrum-bar {
    height: 8px; border-radius: 4px; position: relative; margin-bottom: 5px;
    background: linear-gradient(to right, 
        #8b00ff 0%,   /* 400nm Violet */
        #0000ff 17%,  /* 450nm Blue */
        #00ff00 33%,  /* 500nm Green */
        #ffff00 50%,  /* 550nm Yellow */
        #ff7f00 67%,  /* 600nm Orange */
        #ff0000 83%,  /* 650nm Red */
        #7f0000 100%  /* 700nm Deep Red */
    );
}
.spectrum-dot {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 14px; height: 14px; border-radius: 50%; 
    border: 3px solid white; background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); cursor: pointer;
}
.spectrum-dot:hover { 
    width: 72px; height: 72px; border-radius: 6px; 
    background: var(--dot-color); border: none; box-shadow: none;
}
.spectrum-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }

/* Chart Toggles */
.card-title-row { display: flex; justify-content: space-between; align-items: center; }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: 0.2s; }
.btn-icon:hover { color: var(--primary); background: rgba(37,99,235,0.1); }

/* UV-Vis Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
    opacity: 0; transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content {
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    width: 95%; max-width: 1400px;
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05); 
    padding: 30px 40px;
    transform: scale(0.95) translateY(10px); 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; }
.modal-header h3 { color: var(--text-main); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center;}
.btn-close-modal { background: rgba(0,0,0,0.05); border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 50%; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-close-modal:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.modal-body { height: 70vh; min-height: 500px; width: 100%; position: relative; }

/* ====== About Modal ====== */
.about-modal .modal-content {
    max-width: 920px;
    padding: 44px 52px 36px;
    max-height: 88vh;
    overflow-y: auto;
    background-color: #f0f2f5;
    border-radius: 18px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.28);
    position: relative;
}

/* Scrollbar */
.about-modal .modal-content::-webkit-scrollbar { width: 6px; }
.about-modal .modal-content::-webkit-scrollbar-track { background: transparent; }
.about-modal .modal-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.about-modal .modal-content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Close button */
.about-modal .btn-close-about {
    position: absolute;
    right: 22px;
    top: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e2e8f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}
.about-modal .btn-close-about:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* Header / Title area */
.about-header {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 6px;
}
.about-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.15;
}
.about-title .brand {
    font-weight: 800;
    letter-spacing: -1px;
}
.about-title .product {
    font-weight: 300;
    color: #475569;
}
.about-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: #64748b;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    letter-spacing: 0.8px;
}

/* Body text */
.about-body {
    color: #334155;
    line-height: 1.8;
    font-size: 0.95rem;
    font-weight: 400;
}
.about-body p {
    margin-bottom: 14px;
    text-align: justify;
}
.about-body p:last-child {
    margin-bottom: 20px;
}
.about-body strong {
    font-weight: 700;
    color: #1e293b;
}
.about-body a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.about-body a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Dividers */
.about-divider {
    border: none;
    margin: 24px 0;
}
.about-divider.thick {
    border-top: 1.5px solid #1e293b;
}
.about-divider.thin {
    border-top: 1px solid #cbd5e1;
}

/* Section labels (DISCLAIMER, DEVELOPER) */
.about-section-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 3.5px;
    color: #475569;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
}

/* Disclaimer section */
.about-disclaimer {
    margin-bottom: 8px;
}
.about-disclaimer-text {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.7;
    text-align: justify;
}

/* Footer section */
.about-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4px;
}
.about-developer-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
}
.about-developer-name .email {
    color: #2563eb;
    font-weight: 600;
}
.about-copyright {
    text-align: right;
    color: #64748b;
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
    line-height: 1.6;
}
.about-version {
    margin-top: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #94a3b8;
    text-transform: uppercase;
}
