/* style.css */
/* Modern macOS Light Mode design system for Ballistic Trajectory Simulator */

:root {
    --bg-primary: #f5f5f7;
    --bg-sidebar: rgba(255, 255, 255, 0.82);
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-active: rgba(0, 113, 227, 0.4);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --accent-blue-light: rgba(0, 113, 227, 0.1);
    --status-green: #34c759;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* App Navbar */
.app-navbar {
    height: 52px;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    color: var(--accent-blue);
}

.nav-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.nav-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
}

.controls-area {
    display: flex;
    align-items: center;
}

.preset-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.preset-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.preset-select:hover {
    border-color: var(--text-muted);
}

.preset-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

/* Main App Body Layout */
.app-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 52px);
    position: relative;
    overflow: hidden;
}

/* Sidebars (Left and Right) */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.right-sidebar {
    width: 360px;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.parameter-groups-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-group {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
}

.group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

/* Control Slider Item */
.control-item {
    margin-bottom: 10px;
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
}

.label-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.control-icon {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.value-display {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    background-color: var(--accent-blue-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e5e5ea;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider::-webkit-slider-thumb:active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Center 3D Scene Viewport */
.main-content {
    flex: 1;
    position: relative;
    height: 100%;
    background-color: #ffffff;
}

.canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Overlays on 3D viewport */
.overlay-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 12px;
}

.scene-overlay-top {
    position: absolute;
    top: 15px;
    left: 15px;
    pointer-events: none;
    z-index: 5;
}

.banner-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-green);
    box-shadow: 0 0 8px var(--status-green);
}

.status-indicator.calculating {
    background-color: #ff9500;
    box-shadow: 0 0 8px #ff9500;
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.scene-overlay-bottom {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 5;
}

.animation-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}

.toolbar-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.toolbar-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.toolbar-btn:active {
    transform: scale(0.92);
}

.timeline-slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #d1d1d6;
    outline: none;
    cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
}

.mono-text {
    font-family: var(--font-mono);
}

#anim-time-display {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 95px;
    text-align: right;
}

/* Right Sidebar Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px 15px 5px 15px;
    flex-shrink: 0;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Tab Layout on Right Sidebar */
.details-tab-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-height: 0; /* Important for flex-child scrolling */
}

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    gap: 16px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 0;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-blue);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-blue);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.tab-content.active {
    display: flex;
}

/* Charts Wrapper */
.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 180px;
    margin-bottom: 12px;
}

.chart-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chart-select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-family: var(--font-sans);
    font-size: 12px;
    outline: none;
}

/* DOF Table container styling */
.table-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
}

.dof-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.dof-table th {
    background-color: #f5f5f7;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 8px 6px;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.dof-table td {
    padding: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.dof-table tbody tr:hover {
    background-color: rgba(0, 113, 227, 0.04);
}

/* Global Buttons & Footers */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    width: 100%;
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.hidden {
    display: none !important;
}

/* Helper Scrollbar Styles for macOS aesthetics */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}
