/* AstroThink NASA-Style HUD Theme */
:root {
    --astro-primary: #00d4ff;
    --astro-secondary: #ff6b35;
    --astro-accent: #ffd700;
    --astro-bg-dark: #0a0a0a;
    --astro-bg-darker: #050505;
    --astro-text: #ffffff;
    --astro-text-dim: #888888;
    --astro-border: #333333;
    --astro-success: #00ff88;
    --astro-warning: #ffaa00;
    --astro-error: #ff4444;
}

body.astrothink {
    background: linear-gradient(135deg, var(--astro-bg-darker) 0%, var(--astro-bg-dark) 100%);
    color: var(--astro-text);
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* NASA-style HUD Header */
.astrothink-header {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid var(--astro-primary);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.astrothink-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.astrothink-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--astro-primary);
    text-decoration: none;
}

.astrothink-logo:hover {
    color: var(--astro-accent);
    text-shadow: 0 0 10px var(--astro-primary);
}

.astrothink-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.science-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--astro-primary);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.science-toggle:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.science-toggle.active {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.science-toggle input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--astro-primary);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.science-toggle input[type="checkbox"]:checked {
    background: var(--astro-primary);
    box-shadow: 0 0 10px var(--astro-primary);
}

.science-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--astro-bg-dark);
    font-weight: bold;
    font-size: 12px;
}

/* Main Content Area */
.astrothink-main {
    margin-top: 80px;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.astrothink-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Demo Cards */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.demo-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--astro-border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.demo-card:hover::before {
    left: 100%;
}

.demo-card:hover {
    border-color: var(--astro-primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transform: translateY(-5px);
}

.demo-card h3 {
    color: var(--astro-primary);
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.demo-card p {
    color: var(--astro-text-dim);
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.demo-card .demo-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Science Mode Overlay */
.science-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.science-overlay.active {
    display: flex;
}

.science-content {
    background: var(--astro-bg-dark);
    border: 2px solid var(--astro-primary);
    border-radius: 10px;
    padding: 2rem;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.science-content h3 {
    color: var(--astro-primary);
    margin-top: 0;
    text-align: center;
}

.science-content .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--astro-error);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.science-content .close-btn:hover {
    background: #ff6666;
}

/* Interactive Elements */
.astrothink-slider {
    width: 100%;
    height: 6px;
    background: var(--astro-border);
    border-radius: 3px;
    outline: none;
    appearance: none;
    margin: 1rem 0;
}

.astrothink-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--astro-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--astro-primary);
}

.astrothink-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--astro-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--astro-primary);
}

.astrothink-button {
    background: linear-gradient(45deg, var(--astro-primary), var(--astro-secondary));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.astrothink-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

.astrothink-button:active {
    transform: translateY(0);
}

.astrothink-button.active {
    background: var(--astro-success) !important;
    box-shadow: 0 0 20px var(--astro-success);
    animation: pulse 2s infinite;
}

/* Canvas and Visualization Areas */
.astrothink-canvas {
    border: 2px solid var(--astro-border);
    border-radius: 10px;
    background: var(--astro-bg-darker);
    margin: 1rem 0;
}

.astrothink-canvas:hover {
    border-color: var(--astro-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* Data Display */
.telemetry-display {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--astro-border);
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.telemetry-value {
    color: var(--astro-primary);
    font-weight: bold;
}

.telemetry-label {
    color: var(--astro-text-dim);
    margin-right: 0.5rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--astro-primary); }
    50% { box-shadow: 0 0 20px var(--astro-primary), 0 0 30px var(--astro-primary); }
}

.pulse {
    animation: pulse 2s infinite;
}

.glow {
    animation: glow 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .astrothink-header {
        padding: 0.5rem 1rem;
    }
    
    .astrothink-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .astrothink-logo {
        font-size: 1.2rem;
        gap: 0.5rem;
    }
    
    .astrothink-controls {
        gap: 0.5rem;
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }
    
    .science-toggle {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .astrothink-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .astrothink-main {
        margin-top: 120px;
        padding: 0.5rem;
    }
    
    .astrothink-container {
        padding: 0;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .demo-card {
        padding: 1rem;
    }
    
    .demo-card h3 {
        font-size: 1.1rem;
    }
    
    .demo-card .demo-icon {
        font-size: 1.5rem;
    }
    
    .science-content {
        max-width: 95%;
        padding: 1rem;
        margin: 1rem;
    }
    
    .astrothink-canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        margin: 0.5rem 0;
    }
    
    .telemetry-display {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .telemetry-display h4 {
        font-size: 0.9rem;
    }
    
    .telemetry-display div {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .astrothink-header {
        padding: 0.25rem 0.5rem;
    }
    
    .astrothink-main {
        margin-top: 140px;
        padding: 0.25rem;
    }
    
    .astrothink-logo {
        font-size: 1rem;
    }
    
    .astrothink-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .science-toggle {
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    .astrothink-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .demo-card {
        padding: 0.75rem;
    }
    
    .demo-card h3 {
        font-size: 1rem;
    }
    
    .demo-card p {
        font-size: 0.8rem;
    }
    
    .science-content {
        padding: 0.75rem;
        margin: 0.5rem;
    }
    
    .science-content h3 {
        font-size: 1.1rem;
    }
    
    .telemetry-display {
        padding: 0.4rem;
    }
    
    .telemetry-display h4 {
        font-size: 0.8rem;
    }
    
    .telemetry-display div {
        font-size: 0.7rem;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--astro-border);
    border-radius: 50%;
    border-top-color: var(--astro-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.success {
    background: var(--astro-success);
    box-shadow: 0 0 10px var(--astro-success);
}

.status-indicator.warning {
    background: var(--astro-warning);
    box-shadow: 0 0 10px var(--astro-warning);
}

.status-indicator.error {
    background: var(--astro-error);
    box-shadow: 0 0 10px var(--astro-error);
}

/* Grid Layout for Demos - FIXED LAYOUT */
.demo-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: start;
    min-height: 0; /* Critical for proper scrolling */
}

.demo-controls {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--astro-border);
    border-radius: 10px;
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 100px;
}

.demo-controls::-webkit-scrollbar {
    width: 6px;
}

.demo-controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.demo-controls::-webkit-scrollbar-thumb {
    background: var(--astro-primary);
    border-radius: 3px;
}

.demo-visualization {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--astro-border);
    border-radius: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 500px;
    aspect-ratio: 16/10;
}

.demo-visualization canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Mobile-specific demo layout */
@media (max-width: 1024px) {
    .demo-layout {
        grid-template-columns: 350px 1fr;
        gap: 1rem;
    }
    
    .demo-controls {
        max-height: calc(100vh - 180px);
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .demo-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
        padding: 0.5rem;
    }
    
    .demo-controls {
        width: 100%;
        padding: 1rem;
        order: 2;
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    .demo-visualization {
        width: 100%;
        padding: 0;
        order: 1;
        min-height: 400px;
        max-height: 60vh;
        aspect-ratio: 4/3;
    }
    
    /* Mobile touch buttons */
    .mobile-controls {
        display: flex;
        gap: 1rem;
        margin-top: 1rem;
        position: sticky;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        padding: 1rem;
        z-index: 100;
        width: 100%;
    }
    
    .mobile-controls .astrothink-button {
        flex: 1;
        min-height: 70px;
        font-size: 1.4rem;
        width: 48%;
        box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    }
    
    .demo-controls h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .demo-controls label {
        font-size: 0.9rem;
    }
    
    .astrothink-slider {
        margin: 0.5rem 0;
    }
    
    .astrothink-button {
        margin: 0.25rem 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .demo-layout {
        gap: 0.5rem;
        margin: 0.5rem 0;
        padding: 0.25rem;
    }
    
    .demo-controls {
        padding: 0.75rem;
    }
    
    .demo-visualization {
        padding: 0;
        min-height: 350px;
        aspect-ratio: 4/3;
    }
    
    .mobile-controls .astrothink-button {
        min-height: 70px;
        font-size: 1.4rem;
    }
    
    .demo-controls h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .demo-controls label {
        font-size: 0.8rem;
    }
    
    .astrothink-slider {
        margin: 0.25rem 0;
    }
    
    .astrothink-button {
        margin: 0.2rem 0;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
}

/* Mobile Canvas and Overlay Styles */
@media (max-width: 768px) {
    .astrothink-canvas {
        max-width: 100%;
        height: auto;
        border-radius: 5px;
    }
    
    /* Mobile overlay positioning */
    .demo-visualization > div[style*="position: absolute"] {
        position: relative !important;
        margin: 0.5rem 0;
        background: rgba(0, 0, 0, 0.8) !important;
        border-radius: 5px;
        padding: 0.5rem;
    }
    
    /* Hide some overlays on mobile to reduce clutter */
    .demo-visualization > div[style*="position: absolute"]:nth-child(n+3) {
        display: none;
    }
    
    /* Make mission objectives responsive */
    .telemetry-display div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    /* Responsive status indicators */
    .status-indicator {
        width: 8px;
        height: 8px;
        margin-right: 0.25rem;
    }
}

@media (max-width: 480px) {
    .astrothink-canvas {
        border-radius: 3px;
    }
    
    /* Further reduce overlay clutter on small screens */
    .demo-visualization > div[style*="position: absolute"]:nth-child(n+2) {
        display: none;
    }
    
    /* Single column for mission objectives on very small screens */
    .telemetry-display div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.25rem !important;
    }
    
    /* Smaller status indicators */
    .status-indicator {
        width: 6px;
        height: 6px;
        margin-right: 0.2rem;
    }
}

/* Touch-friendly interactions */
@media (max-width: 768px) {
    .astrothink-button {
        min-height: 44px; /* iOS touch target size */
        touch-action: manipulation;
    }
    
    .astrothink-slider {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .astrothink-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .astrothink-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    /* Make science toggle touch-friendly */
    .science-toggle {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .science-toggle input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
}

/* Paper Airplane Demo - Enhanced Styles */

/* Loading State */
.loading-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    color: var(--astro-primary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--astro-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* WebGL Error */
.webgl-error {
    background: rgba(255, 68, 68, 0.2);
    border: 2px solid var(--astro-error);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: var(--astro-text);
    margin: 2rem auto;
    max-width: 500px;
}

.webgl-error h3 {
    color: var(--astro-error);
    margin-top: 0;
}

/* Tooltip Icons */
.tooltip-icon {
    cursor: help;
    opacity: 0.6;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.tooltip-icon:hover {
    opacity: 1;
}

/* How It Works Section */
.how-it-works {
    border: 1px solid var(--astro-border);
    border-radius: 5px;
    padding: 0.5rem;
}

.how-it-works summary {
    list-style: none;
    user-select: none;
}

.how-it-works summary::-webkit-details-marker {
    display: none;
}

.how-it-works summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
}

.how-it-works[open] summary::before {
    transform: rotate(90deg);
}

/* Preset Buttons */
.preset-btn {
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
    transition: all 0.2s;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.3);
}

.preset-btn:active {
    transform: translateY(0);
}

/* Select Dropdown */
.astrothink-select {
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.astrothink-select:hover {
    border-color: var(--astro-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.astrothink-select:focus {
    outline: none;
    border-color: var(--astro-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Challenge Mode Active */
#challenge-mode-btn.active {
    background: var(--astro-success) !important;
    box-shadow: 0 0 20px var(--astro-success);
}

/* Score Display */
#current-score {
    transition: all 0.3s;
}

.score-update {
    animation: scorePulse 1s ease-in-out;
}

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

/* Improved Telemetry Highlight */
.telemetry-value.improved {
    animation: glow 2s ease-in-out;
    color: var(--astro-success) !important;
    font-weight: bold;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px var(--astro-success);
        box-shadow: 0 0 10px var(--astro-success);
    }
    50% {
        text-shadow: 0 0 15px var(--astro-success);
        box-shadow: 0 0 20px var(--astro-success);
    }
}

/* Flight History */
.flight-history-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    border-left: 3px solid var(--astro-primary);
    font-size: 0.85rem;
}

/* Fun Facts Panel */
#fun-facts {
    animation: slideUp 0.3s ease-out;
    backdrop-filter: blur(10px);
}

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

/* Flight Message */
.flight-message {
    pointer-events: none;
    user-select: none;
}

/* Science Explanation Popup */
.science-explanation-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--astro-primary);
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    z-index: 4000;
    animation: fadeIn 0.3s ease-out;
}

.science-explanation-content {
    color: var(--astro-text);
}

.science-explanation-content h3 {
    color: var(--astro-primary);
    margin-top: 0;
}

.science-explanation-content ul {
    text-align: left;
    margin: 1rem 0;
}

.science-explanation-content button {
    background: var(--astro-primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    margin-top: 1rem;
    transition: all 0.2s;
}

.science-explanation-content button:hover {
    background: var(--astro-accent);
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Force Graph */
#force-graph {
    backdrop-filter: blur(10px);
}

#force-graph-canvas {
    display: block;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .how-it-works {
        font-size: 0.8rem;
    }
    
    .preset-btn {
        font-size: 0.7rem !important;
        padding: 0.4rem !important;
    }
    
    .science-explanation-popup {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    #fun-facts {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    #force-graph {
        bottom: 50px;
        right: 5px;
        padding: 8px;
    }
    
    #force-graph-canvas {
        width: 150px;
        height: 75px;
    }
    
    .flight-history-item {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
}

@media (max-width: 480px) {
    .preset-btn {
        font-size: 0.65rem !important;
        padding: 0.35rem !important;
    }
    
    #fun-facts {
        font-size: 0.75rem;
        padding: 6px;
        bottom: 5px;
        left: 5px;
        right: 5px;
    }
    
    #force-graph {
        display: none; /* Hide on very small screens */
    }
    
    .science-explanation-popup {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Coaching System Styles */
.coaching-panel {
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid var(--astro-primary);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coaching-advice {
    color: var(--astro-text);
    font-size: 0.95rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.coaching-indicators {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.coaching-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.85rem;
}

.coaching-indicator.increase {
    color: var(--astro-success);
}

.coaching-indicator.decrease {
    color: var(--astro-error);
}

.auto-tune-btn {
    width: 100%;
    margin-top: 0.5rem;
    background: var(--astro-accent) !important;
    font-weight: bold;
}

/* Target Predictor Line */
.predictor-line {
    stroke: var(--astro-accent);
    stroke-width: 2;
    stroke-dasharray: 10, 5;
    opacity: 0.7;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -15;
    }
}

/* Distance Feedback */
.distance-feedback {
    position: absolute;
    top: 50px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--astro-primary);
    z-index: 20;
    font-size: 0.9rem;
}

.distance-feedback.warm {
    border-color: var(--astro-warning);
    box-shadow: 0 0 15px var(--astro-warning);
}

.distance-feedback.hot {
    border-color: var(--astro-success);
    box-shadow: 0 0 20px var(--astro-success);
}

/* Recommended Settings */
.recommended-settings {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--astro-success);
    border-radius: 5px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.recommended-settings button {
    margin-top: 0.5rem;
    width: 100%;
    background: var(--astro-success);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.recommended-settings button:hover {
    background: var(--astro-primary);
    transform: scale(1.02);
}

/* Practice Mode */
.practice-mode-indicator {
    background: rgba(255, 170, 0, 0.2);
    border: 1px solid var(--astro-warning);
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5000;
    animation: celebrationFlash 0.5s ease-out;
}

@keyframes celebrationFlash {
    0% {
        background: rgba(255, 255, 255, 0);
    }
    50% {
        background: rgba(0, 255, 136, 0.3);
    }
    100% {
        background: rgba(255, 255, 255, 0);
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--astro-accent);
    animation: confettiFall 3s linear;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Collapsible Sections */
.collapsible-section {
    margin: 0.5rem 0;
}

.collapsible-section summary {
    cursor: pointer;
    color: var(--astro-accent);
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    user-select: none;
}

.collapsible-section summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.collapsible-section[open] summary {
    border-bottom: 1px solid var(--astro-border);
    border-radius: 5px 5px 0 0;
}

.collapsible-section .collapsible-content {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 5px 5px;
}

/* Heat Map / Landing Spots */
.landing-heatmap {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    max-width: 200px;
}

.landing-spot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--astro-primary);
    opacity: 0.6;
}

/* Getting Warmer/Colder Indicator */
.temperature-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Mobile Fullscreen */
.fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--astro-primary);
    color: var(--astro-primary);
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
}

@media (min-width: 769px) {
    .fullscreen-btn,
    .mobile-controls {
        display: none;
    }
}

/* Touch-friendly Sliders */
@media (max-width: 768px) {
    .astrothink-slider {
        min-height: 50px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .astrothink-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .astrothink-slider::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
}

/* Prevent zoom on double-tap */
@media (max-width: 768px) {
    * {
        touch-action: manipulation;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Circuits Demo Specific Styles */
#connect-mode-btn.active {
    background: var(--astro-success) !important;
    box-shadow: 0 0 20px var(--astro-success);
    animation: pulse 2s infinite;
}

/* LED Glow Animation */
@keyframes ledGlow {
    0%, 100% {
        opacity: 0.8;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.5);
    }
}

.led-powered {
    animation: ledGlow 1s ease-in-out infinite;
}

/* Wire Connection Glow */
.wire-powered {
    filter: drop-shadow(0 0 5px var(--astro-primary));
}

/* Component Terminal Highlight */
.component-terminal {
    fill: var(--astro-primary);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.component-terminal:hover {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--astro-primary));
}

/* Demo Circuits Styles */
.demo-circuit-card {
    transition: all 0.3s ease;
}

.demo-circuit-card:hover {
    transform: translateY(-2px);
}

.load-demo-btn:hover {
    background: var(--astro-success) !important;
    transform: scale(1.02);
}

.load-demo-btn:active {
    transform: scale(0.98);
}

/* Demo Explanation Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20%, 80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Mobile adjustments for demo circuits */
@media (max-width: 768px) {
    #demo-explanation {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        padding: 1rem !important;
    }
    
    .demo-circuit-card {
        padding: 0.5rem !important;
    }
}
