:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(20, 27, 45, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #3b82f6;
    --radius: 16px;
    --transition: 0.3s ease;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Animated Blobs */
.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #3b82f6, #1d4ed8);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6, #4c1d95);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Main Container */
.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem 0;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.5;
}

.main-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: stretch;
}

.card-side-header {
    flex: 0 0 60px; /* Fixed width to guarantee vertical alignment across all cards */
    border-right: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-side-header h2 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin: 0;
    text-align: center;
    color: var(--accent);
    font-size: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.split-content {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 2rem;
}

.divider {
    background: var(--panel-border);
    width: 1px;
    height: 100%;
}

.side-title {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 900px) {
    .split-content {
        grid-template-columns: 1fr;
    }
    .divider {
        width: 100%;
        height: 1px;
        margin: 1rem 0;
    }
}

.center {
    text-align: center;
    display: flex;
    justify-content: center;
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.subsection-title {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #fff;
}

input:disabled + .slider {
    cursor: default;
    opacity: 0.5;
}

.tgt-highlight {
    position: relative;
}

.tgt-highlight::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: -1rem;
    right: -1rem;
    bottom: -1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.03);
    border-radius: 8px;
    z-index: -1;
    pointer-events: none;
}

/* Removed .panel and .section-header */

.crosshair-header {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--panel-border);
}

/* Inputs */
.input-group-row {
    display: flex;
    gap: 1rem;
}

.input-group-row .input-group {
    flex: 1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crosshair-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

input[type="number"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: default;
}

/* Radio Buttons for Conversion Mode */
.horizontal-mode {
    flex-direction: row !important;
    justify-content: center;
}

.conversion-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.radio-container {
    display: flex;
    align-items: center;
    position: relative;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.radio-container:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: transparent;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    margin-right: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.radio-container input:checked ~ .checkmark {
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.radio-container input:checked ~ .checkmark:after {
    display: block;
}

.radio-container input:checked ~ .mode-text strong {
    color: var(--accent);
}

.mode-text {
    display: flex;
    flex-direction: column;
}

.mode-text strong {
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
}

.mode-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Removed read-only results grid */

/* Real World Physics */
.real-world-metrics {
    margin-top: 1.5rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.metric-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.metric-title {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-val {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cbd5e1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Canvas Preview */
.preview-container {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-container h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    align-self: flex-start;
}

.canvas-wrapper {
    background: #1e293b;
    border: 2px solid var(--panel-border);
    border-radius: 8px;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

canvas {
    display: block;
}
