/* ============================================
   PROJECTILE MOTION SIMULATOR — PREMIUM DESIGN
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(79, 195, 247, 0.3);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #4fc3f7;
    --accent-glow: rgba(79, 195, 247, 0.15);
    --accent-gradient: linear-gradient(135deg, #4fc3f7 0%, #7c4dff 100%);

    --success: #66bb6a;
    --warning: #ffa726;
    --danger: #ef5350;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.15);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(79, 195, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124, 77, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* --- App Container --- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-glow);
}

.header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1px;
}

.header-right {
    display: flex;
    gap: 8px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 100px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.badge-accent {
    background: var(--accent-glow);
    border-color: var(--border-active);
    color: var(--accent);
}

/* --- Main Layout --- */
.main-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    flex: 1;
}

/* --- Canvas Section --- */
.canvas-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.canvas-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex: 1;
    min-height: 500px;
}

.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.canvas-overlay-info {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.canvas-wrapper:hover .canvas-overlay-info {
    opacity: 1;
}

/* --- Action Bar --- */
.action-bar {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(79, 195, 247, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-active);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* --- Controls Panel --- */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.controls-panel::-webkit-scrollbar {
    width: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.control-group {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.control-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.control-title svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* --- Planet Grid --- */
.planet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.planet-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    font-family: var(--font-main);
}

.planet-btn:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.planet-btn.active {
    background: var(--accent-glow);
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

.planet-emoji {
    font-size: 1.3rem;
    line-height: 1;
}

.planet-name {
    font-size: 0.75rem;
    font-weight: 600;
}

.planet-gravity {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* --- Sliders --- */
.slider-control {
    margin-bottom: 16px;
}

.slider-control:last-child {
    margin-bottom: 0;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-header label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.4);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.4);
    cursor: pointer;
    border: none;
}

.slider-range {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-active);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Equation Box --- */
.equation-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    line-height: 1.8;
    text-align: center;
}

.equation {
    padding: 2px 0;
}

/* --- Animations --- */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.control-group {
    animation: slideIn 0.4s ease both;
}

.control-group:nth-child(1) { animation-delay: 0.05s; }
.control-group:nth-child(2) { animation-delay: 0.1s; }
.control-group:nth-child(3) { animation-delay: 0.15s; }
.control-group:nth-child(4) { animation-delay: 0.2s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }

    .canvas-wrapper {
        min-height: 400px;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-right {
        justify-content: center;
    }

    .action-bar {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .planet-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .canvas-wrapper {
        min-height: 300px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ==========================================================================
   MONOCHROME STRUCTURAL ENGINEERING DESIGN SYSTEM OVERRIDE
   Bans AI dashboard cliches: gradients, glassmorphism, neon glow, shadows
   ========================================================================== */
:root {
    --bg-primary: #0b0b0d !important;
    --bg-secondary: #121215 !important;
    --bg-dark: #0b0b0d !important;
    --bg-base: #0b0b0d !important;
    --bg-main: #0b0b0d !important;
    --bg-surface: #121215 !important;
    --bg-card: #121215 !important;
    --bg-panel: #121215 !important;
    --bg-card-hover: #18181c !important;
    --bg-glass: #0b0b0d !important;
    --bg-glass-hover: #18181c !important;
    --border-subtle: #242429 !important;
    --border-color: #242429 !important;
    --border-active: #323238 !important;
    --border-bright: #323238 !important;
    --border-focus: #38bdf8 !important;
    --text-primary: #f4f4f6 !important;
    --text-main: #f4f4f6 !important;
    --text-secondary: #a1a1aa !important;
    --text-muted: #71717a !important;
    --text-faint: #71717a !important;
    --accent: #38bdf8 !important;
    --neon: #38bdf8 !important;
    --gold: #38bdf8 !important;
    --cyan-primary: #38bdf8 !important;
    --radius-sm: 4px !important;
    --radius-md: 6px !important;
    --radius-lg: 6px !important;
    --radius-xl: 6px !important;
    --shadow-sm: none !important;
    --shadow-md: none !important;
    --shadow-lg: none !important;
    --shadow-glow: none !important;
    --shadow-glow-prey: none !important;
    --shadow-glow-pred: none !important;
}

body {
    background: #0b0b0d !important;
    background-image: none !important;
    color: #f4f4f6 !important;
}

body::before, body::after {
    display: none !important;
}

*, *::before, *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.header, .app-header, .top-bar, .navbar {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #242429 !important;
    border-radius: 0 !important;
    padding: 0 0 18px 0 !important;
    margin-bottom: 8px !important;
}

.logo-icon, .brand-icon, .header-icon, .pulse-dot, .pulse-indicator, .live-dot, .status-dot {
    display: none !important;
}

h1, .header h1, .app-header h1 {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #f4f4f6 !important;
    background-clip: initial !important;
    color: #f4f4f6 !important;
    font-size: 1.45rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.025em !important;
}

.badge, .badge-accent, .status-badge, .header-badge, .pill-badge {
    background: #121215 !important;
    border: 1px solid #242429 !important;
    color: #71717a !important;
    border-radius: 4px !important;
    font-family: var(--font-mono) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
}

.card, .panel, .control-panel, .sidebar-panel, .metric-card, .kpi-card, .stat-card, .canvas-wrapper, .chart-card, .panel-card, .formula-card, .info-card {
    background: #121215 !important;
    border: 1px solid #242429 !important;
    border-radius: 6px !important;
}

.metric-value, .kpi-value, .stat-value {
    font-family: var(--font-mono) !important;
    color: #f4f4f6 !important;
    font-weight: 600 !important;
}

button, .btn, .btn-primary, .preset-btn, .action-btn {
    border-radius: 4px !important;
}

.btn-primary, .btn-play, .btn-run {
    background: #f4f4f6 !important;
    color: #0b0b0d !important;
    border: 1px solid #f4f4f6 !important;
    font-weight: 600 !important;
}

input[type="range"] {
    height: 4px !important;
    background: #323238 !important;
    border-radius: 2px !important;
}

input[type="range"]::-webkit-slider-thumb {
    width: 14px !important;
    height: 14px !important;
    background: #38bdf8 !important;
    border: 2px solid #0b0b0d !important;
    border-radius: 50% !important;
}
