/* Modern Reset & Color Variable System */
:root {
    --bg-primary: #0a0e17;
    --bg-surface: rgba(16, 24, 40, 0.65);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-stroke: rgba(255, 255, 255, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.35);
    
    --primary: #38bdf8;         /* Cyan */
    --primary-hover: #7dd3fc;
    --primary-light: rgba(56, 189, 248, 0.12);
    --accent: #f43f5e;          /* Neon Pink */
    --accent-light: rgba(244, 63, 94, 0.15);
    
    --gradient-1: linear-gradient(135deg, #0284c7 0%, #d946ef 100%);
    --gradient-glow: linear-gradient(90deg, #38bdf8 0%, #ec4899 100%);
    --glass-blur: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Floating Blur Blobs */
.glass-bg {
    position: fixed;
    top: -15%;
    left: -15%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: float 25s infinite alternate;
}

.glass-bg-2 {
    position: fixed;
    bottom: -15%;
    right: -15%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, rgba(236, 72, 153, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: float 30s infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 8%) scale(1.05); }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.header-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Main Container */
.dashboard-container {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 0 2rem;
    flex-grow: 1;
    width: 100%;
}

.welcome-hero {
    margin-bottom: 2.5rem;
    text-align: center;
}

.gradient-text {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Simulator Grid Layout */
.simulator-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

/* Cards style */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin-bottom: 2rem;
}

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

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Canvas & Graph wrappers */
.canvas-wrapper, .graph-wrapper {
    position: relative;
    width: 100%;
    background: #040711;
    border-radius: 12px;
    border: 1px solid var(--border-stroke);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.canvas-overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(4, 7, 17, 0.85);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    backdrop-filter: blur(4px);
}

/* Icon Buttons controls */
.canvas-controls {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-stroke);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

/* Controls panel right side */
.control-panel {
    display: flex;
    flex-direction: column;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.mode-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-stroke);
    color: var(--text-secondary);
    padding: 0.65rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* Sliders */
.slider-group {
    margin-bottom: 1.25rem;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.val-display {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    border: 2px solid #ffffff;
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Theory section */
.theory-content {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.theory-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.theory-content p {
    margin-bottom: 0.75rem;
}

.theory-content strong {
    color: var(--text-primary);
}

.formula {
    background: rgba(4, 7, 17, 0.5);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
    margin: 1rem 0;
    font-family: 'Fira Code', monospace;
    color: var(--primary);
    font-size: 0.95rem;
    overflow-x: auto;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    margin-top: auto;
}

/* Responsive adjustment */
@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .card {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem 1.5rem;
    }
    
    .control-panel {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .welcome-hero h1 {
        font-size: 2rem;
    }
}

/* Launch Info Badge Styles */
.launch-info-badge {
    background: var(--primary-light);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: simple-pulse 1.5s infinite;
}

@keyframes simple-pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Guided Mode Status Displays */
.mode-status-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-stroke);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.mode-status-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mode-status-item strong {
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

.mode-status-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    font-style: italic;
    line-height: 1.4;
}

.formula-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* Number Input and Apply Button Styles */
.input-actions-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-stroke);
    border-radius: 6px;
    padding: 2px 5px;
}

.param-input {
    background: transparent;
    border: none;
    color: var(--primary);
    width: 48px;
    text-align: right;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

.param-input::-webkit-outer-spin-button,
.param-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.param-input {
    -moz-appearance: textfield;
}

.param-unit {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-right: 2px;
}

.btn-apply {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apply:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.2);
}

/* Canvas Legend Styles */
.canvas-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: rgba(4, 7, 17, 0.4);
    border: 1px solid var(--border-stroke);
    border-radius: 8px;
    padding: 8px 16px;
    margin: 8px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.cyan-glow {
    background: #06b6d4;
    box-shadow: 0 0 6px #06b6d4;
}

.pink-glow {
    background: #f43f5e;
    box-shadow: 0 0 6px #f43f5e;
}

.white-line {
    background: #ffffff;
    height: 2px;
    width: 18px;
    display: inline-block;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

/* Tabs Navigation Bar Styles */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-stroke);
    padding-bottom: 1.2rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-stroke);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Tab Panel Display Visibility Toggle */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active-tab {
    display: flex; /* simulator-layout flex behavior */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom styles for select dropdown */
.param-select {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.param-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}
