/*
# Mobile-First Responsive CSS Framework for Interactive Canvas Applications

## Overview
This CSS framework provides a comprehensive mobile-first responsive design system optimized for interactive canvas-based applications with control panels. Features smooth animations, touch-friendly interfaces, and professional dark theme aesthetics.

## Key Features & Functions

### Layout System
- **Mobile-First Grid**: Single column on mobile, dual-column (canvas + controls) on desktop
- **Responsive Container**: Adaptive padding and spacing across breakpoints
- **Viewport Optimization**: Full-height layouts with proper mobile viewport handling

### Canvas Integration
- **Responsive Canvas Container**: Maintains aspect ratio on mobile, fills viewport on desktop
- **Touch-Optimized Interactions**: Prevents unwanted text selection and tap highlights
- **Visual Enhancements**: Gradient backgrounds, subtle grid overlays, and depth shadows
- **Zoom Controls**: Floating zoom buttons with backdrop blur effects

### Control Panel System
- **Collapsible Sections**: Mobile-friendly accordion panels with smooth animations
- **Desktop Always-Expanded**: Automatic expansion on larger screens
- **Scrollable Content**: Custom scrollbars with gradient styling
- **Touch-Friendly Targets**: Minimum 44px touch targets for mobile accessibility

### Input Components
- **Enhanced Range Sliders**: Custom-styled with gradient thumbs and larger touch areas
- **Responsive Buttons**: Gradient backgrounds with hover animations and proper spacing
- **Value Displays**: Real-time value indicators with styled containers
- **Button Groups**: Flexible layouts that stack on mobile

### Mobile Optimizations
- **Prevent Selection Flash**: Disabled text selection on interactive elements
- **Touch Behavior**: Proper touch-action and tap highlight removal
- **Smooth Animations**: Hardware-accelerated transitions with cubic-bezier easing
- **Accessibility**: Focus states and proper contrast ratios maintained

### Visual Theme
- **Dark Gradient Theme**: Sophisticated dark blue gradient backgrounds
- **Glassmorphism Effects**: Backdrop blur and transparency layers
- **Color System**: Blue-to-green gradient accents throughout
- **Typography**: System font stack with proper sizing hierarchy

## Returns/Provides
- Fully responsive layout system for canvas + controls interfaces
- Touch-optimized mobile experience with collapsible panels
- Professional dark theme with consistent visual language
- Smooth animations and transitions for enhanced UX
- Cross-browser compatibility with proper fallbacks
- Accessibility features including focus states and touch targets

## Usage Context
Ideal for interactive data visualization tools, simulation interfaces, creative applications, 
or any canvas-based web application requiring responsive controls and professional aesthetics. 
The framework handles the complete UI shell, leaving canvas content implementation to the application logic.
*/

.controls-content::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #3b82f6, #d4a500);
        border-radius: 4px;
        border: 1px solid rgba(0, 17, 36, 0.3);
    }

    .controls-content::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #3b82f6, #b8950a);
    }* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent text selection flash */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection only where needed */
input, textarea, .selectable-text {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    background: radial-gradient(ellipse at top, #1e3a5f 0%, #0f1a2e 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    color: #f8fafc;
    line-height: 1.5;
    overflow-x: hidden;
    /* UCR Physics logo background */
    position: relative;
    /* Prevent bounce scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* UCR Physics Logo Background */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(58%, -143%);
    width: 30vw;
    height: 50vh;
    background: url('https://www.physics.ucr.edu/sites/default/files/UCRPnA_banner.png') center/contain no-repeat;
    opacity: 0.8;
    z-index: -1;
    pointer-events: none;
}

/* Main Container - Mobile First */
.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    padding: 16px;
    align-items: start;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .container {
        grid-template-columns: 1fr auto;
        gap: 40px;
        padding: 32px;
    }
}

/* Canvas Section */
.canvas-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #1e3a5f, #1e3a5f);
    box-shadow: 
        0 25px 50px -12px rgba(0, 17, 36, 0.8),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(8px);
    /* Mobile: Make canvas responsive */
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
/* Desktop: Canvas fills remaining space except control panel */
@media (min-width: 1024px) {
    .canvas-container {
        max-width: none;
        width: 100%;
        height: 90vh; /* Fill viewport height minus padding */
    }
}

canvas {
    background: transparent !important;
    position: relative;
    z-index: 1;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 215, 0, 0.1);
    width: 100%;
    height: auto;
    max-width: 100%;
    /* Mobile: Aspect ratio */
    aspect-ratio: 1;
}

canvas:active {
    cursor: grabbing;
}

canvas:hover {
    filter: brightness(1.02);
}

/* Enhanced Controls Panel - Mobile First */
.controls {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(145deg, #1e3a5f 0%, #1e3a5f 100%);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 25px 50px -12px rgba(0, 17, 36, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(12px);
    /* Mobile: No height restriction */
    max-height: none;
    overflow: visible;
    position: relative;
}

/* Desktop: Fixed width and height */
@media (min-width: 1024px) {
    .controls {
        width: 380px;
        max-height: 85vh;
        overflow: hidden;
    }
}

.controls-header {
    padding: 24px 24px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(255, 215, 0, 0.1));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px 20px 0 0;
}

.controls-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #e6b800);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.controls-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.controls-content {
    padding: 24px;
    /* Mobile: No height restriction, natural scroll */
    overflow-y: visible;
    height: auto;
}

/* Desktop: Scrollable content */
@media (min-width: 1024px) {
    .controls-content {
        overflow-y: auto;
        height: calc(85vh - 120px);
    }
}

/* Custom Scrollbar - Desktop only */
@media (min-width: 1024px) {
    .controls-content::-webkit-scrollbar {
        width: 8px;
    }

    .controls-content::-webkit-scrollbar-track {
        background: rgba(0, 27, 61, 0.5);
        border-radius: 4px;
    }

    .controls-content::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #3b82f6, #FFD700);
        border-radius: 4px;
        border: 1px solid rgba(0, 27, 61, 0.3);
    }

    .controls-content::-webkit-scrollbar-thumb:hover {
<<<<<<< HEAD
        background: linear-gradient(135deg, #2563eb, #FFC107);
=======
        background: linear-gradient(135deg, #2563eb, #FFD700);
>>>>>>> e75db27b63a078d26d8ea2b4123a634692983809
    }
}

/* Control Sections - Mobile Collapsible with improved animations */
.control-section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(30, 58, 95, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    /* Improved mobile collapsible behavior */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #e6b800, #d4a500);
}

.control-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    /* Mobile: Larger tap target with better touch response */
    min-height: 48px;
    position: relative;
    z-index: 2;
    /* Prevent text selection on headers */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
}

.control-section h3::before {
    content: '';
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #3b82f6, #e6b800);
    border-radius: 50%;
}

/* Mobile: Improved collapsible sections with better animation */
.control-section h3::after {
    content: '▼';
    margin-left: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
    transform-origin: center;
    color: #e6b800;
}

.control-section.collapsed h3::after {
    transform: rotate(-90deg);
}

/* Improved collapsible content with max-height animation */
.control-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.control-section.collapsed .control-content {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: Always expanded */
@media (min-width: 1024px) {
    .control-section h3 {
        cursor: default;
        min-height: auto;
    }
    
    .control-section h3::after {
        display: none;
    }
    
    .control-section.collapsed .control-content {
        max-height: 1000px;
        opacity: 1;
    }
}

/* Control Groups */
.control-group {
    margin-bottom: 20px;
}

label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
    /* Mobile: Larger text */
    min-height: 44px;
    /* Prevent text selection flash */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.value {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    min-width: 50px;
    text-align: center;
}

/* Enhanced Range Inputs - Mobile Friendly */
input[type="range"] {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #0f1a2e, #1e3a5f);
    outline: none;
    margin-bottom: 16px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
    /* Mobile: Larger touch target */
    padding: 10px 0;
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #d4a500);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.4),
        0 0 0 4px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 16px rgba(59, 130, 246, 0.5),
        0 0 0 6px rgba(230, 184, 0, 0.15);
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #d4a500);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    -moz-appearance: none;
}

input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, #0f1a2e, #1e3a5f);
    height: 12px;
    border-radius: 6px;
    border: none;
}

/* Enhanced Buttons - Mobile Friendly */
button {
<<<<<<< HEAD
    background: linear-gradient(135deg, #3b82f6, #d4a500);
=======
    background: linear-gradient(135deg, #3b82f6, #ffd9007c);
>>>>>>> e75db27b63a078d26d8ea2b4123a634692983809
    color: rgb(255, 255, 255);
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(230, 184, 0, 0.2);
    position: relative;
    overflow: hidden;
    /* Mobile: Larger touch target */
    min-height: 48px;
    min-width: 120px;
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.4),
<<<<<<< HEAD
        inset 0 1px 0 rgba(230, 184, 0, 0.3);
    background: linear-gradient(135deg, #2563eb, #b8950a);
=======
        inset 0 1px 0 rgba(230, 230, 0, 0.3);
    background: linear-gradient(135deg, #2563eb, #ffd9007c);
>>>>>>> e75db27b63a078d26d8ea2b4123a634692983809
}

button:active {
    transform: translateY(-1px);
}

.button-group {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Mobile: Stack buttons */
@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
    }
    
    button {
        margin-right: 0;
        width: 100%;
    }
}

/* Zoom Controls - Mobile Friendly */
.zoom-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.zoom-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(30, 58, 95, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    /* Mobile: Larger touch target */
    min-height: 48px;
    min-width: 48px;
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.zoom-btn:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(230, 184, 0, 0.5);
    transform: scale(1.05);
}

.zoom-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(30, 58, 95, 0.8);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(8px);
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Legend and Info Sections */
.legend {
    background: rgba(30, 58, 95, 0.6);
    padding: 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.legend-item {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    /* Mobile: Larger touch target */
    min-height: 36px;
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.legend-item:hover {
    transform: translateX(4px);
}

.color-box {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 2px 4px rgba(0, 27, 61, 0.3);
    flex-shrink: 0;
}

.physics-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(230, 184, 0, 0.1));
    padding: 16px;
    border-radius: 10px;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(4px);
    line-height: 1.5;
    /* Allow text selection for info content */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Canvas enhancements */
.canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.canvas-container::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 17px;
    z-index: -1;
    opacity: 0.3;
}

.graph-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: 
        linear-gradient(90deg, transparent 49.8%, rgba(59, 130, 246, 0.05) 50%, transparent 50.2%),
        linear-gradient(180deg, transparent 49.8%, rgba(59, 130, 246, 0.05) 50%, transparent 50.2%);
    background-size: 60px 60px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.canvas-container:hover .graph-overlay {
    opacity: 0.4;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .container {
        padding: 12px;
        gap: 16px;
    }
    
    .controls-header {
        padding: 20px 20px 12px;
    }
    
    .controls-content {
        padding: 20px;
    }
    
    .control-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .zoom-controls {
        top: 12px;
        right: 12px;
    }
    
    .zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .zoom-info {
        bottom: 12px;
        left: 12px;
        font-size: 11px;
        padding: 10px 14px;
    }
    
    /* Improved mobile touch behavior */
    .control-section h3 {
        /* Add visual feedback for touch */
        transition: background-color 0.2s ease;
    }
    
    .control-section h3:active {
        background-color: rgba(59, 130, 246, 0.15);
        border-radius: 8px;
    }
}

/* Focus states for accessibility */
input[type="range"]:focus {
    outline: 2px solid rgba(255, 215, 0, 0.5);
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid rgba(255, 215, 0, 0.5);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Additional mobile improvements for better collapsible behavior */
@media (max-width: 1023px) {
    /* Ensure collapsible sections work properly on mobile */
    .control-section {
        contain: layout style;
    }
    
    /* Prevent layout shifts during animation */
    .control-content {
        will-change: max-height, opacity;
    }
    
    /* Improve touch response */
    .control-section h3 {
        touch-action: manipulation;
    }
}

/* Prevent unwanted highlighting/selection globally */
::selection {
    background: rgba(59, 130, 246, 0.4);
    color: white;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.4);
    color: white;
}