/* MORPHIA - Morphic Field Visualizer Styles */

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Colors */
    --color-bg: #000200;
    --color-primary: #4ade80;
    --color-primary-dark: #1a441a;
    --color-primary-muted: rgba(51, 255, 51, 0.15);
    --color-text: #aaffaa;
    --color-text-muted: #1a441a;
    --color-yellow: #facc15;
    --color-yellow-dark: #713f12;
    --color-red: #f87171;
    --color-red-dark: #7f1d1d;

    /* Glass effect */
    --glass-bg: rgba(0, 15, 5, 0.65);
    --glass-border: rgba(51, 255, 51, 0.15);
    --glass-blur: 12px;

    /* Transitions */
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
}

/* ========================================
   Base Styles
   ======================================== */
body {
    margin: 0;
    overflow: hidden;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Courier New', monospace;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Canvas Container
   ======================================== */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================
   Cursor States
   ======================================== */
.cursor-cross {
    cursor: crosshair;
}

.cursor-move {
    cursor: move;
}

/* ========================================
   Glass Panel Component
   ======================================== */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: 6px;
    transition: all var(--transition-smooth);
    overflow: hidden;
}

/* ========================================
   Panel Minimize Logic
   ======================================== */
.panel-content {
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    max-height: 1000px;
    opacity: 1;
}

.minimized .panel-content {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.minimized {
    background: rgba(0, 15, 5, 0.4);
    border-color: rgba(51, 255, 51, 0.1);
}

.toggle-icon {
    transition: transform var(--transition-medium);
}

.minimized .toggle-icon {
    transform: rotate(-90deg);
}

/* ========================================
   Custom Range Sliders
   ======================================== */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    background: var(--color-primary);
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 0 10px var(--color-primary);
    border-radius: 50%;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: rgba(74, 222, 128, 0.2);
}

/* Firefox */
input[type=range]::-moz-range-thumb {
    height: 12px;
    width: 12px;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--color-primary);
    border-radius: 50%;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 2px;
    background: rgba(74, 222, 128, 0.2);
}

/* ========================================
   Geometry Buttons
   ======================================== */
.geo-btn {
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 9px;
}

.geo-btn:hover {
    background: var(--color-primary);
    color: black;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.geo-btn.active {
    background: var(--color-primary);
    color: black;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
    font-weight: bold;
}

/* ========================================
   Info Button
   ======================================== */
.info-btn {
    font-weight: bold;
    border: 1px solid var(--color-primary-dark);
    color: var(--color-primary-dark);
    transition: all var(--transition-medium);
}

.info-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

/* ========================================
   Intro Overlay
   ======================================== */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s;
    overflow-y: auto;
    padding: var(--space-xl);
}

/* ========================================
   Mode Selection Cards
   ======================================== */
.mode-card {
    border: 1px solid var(--color-primary-dark);
    padding: var(--space-xl);
    transition: all var(--transition-medium);
    cursor: pointer;
    background: rgba(0, 20, 0, 0.8);
}

.mode-card:hover {
    border-color: var(--color-primary);
    background: rgba(0, 40, 0, 0.9);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(74, 222, 128, 0.2);
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Animations
   ======================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
