/* Zen Koi Pond Screensaver - Styles */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

canvas {
    display: block;
}

#ui {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    pointer-events: none;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Stats Panel */
.stats-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.stats-panel .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stats-panel .stat-row:last-child {
    border-bottom: none;
}

.stats-panel .stat-label {
    color: rgba(255,255,255,0.6);
}

.stats-panel .stat-value {
    font-weight: bold;
    font-family: monospace;
}

.stats-panel .stat-value.fish { color: #81c784; }
.stats-panel .stat-value.predator { color: #ff6b6b; }
.stats-panel .stat-value.birth { color: #64b5f6; }
.stats-panel .stat-value.fps { color: #ffeb3b; }

/* --- SMART MENU BUTTON --- */
#menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10000;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
    animation: spinAndFloat 8s linear infinite;
    pointer-events: auto;
}

#menu-btn:hover {
    animation: spinAndFloatHover 6s linear infinite;
}

/* The Leaf */
.btn-leaf {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #66bb6a, #2e7d32);
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 100%, 
        55% 55%,
        0% 100%
    );
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

/* The Flower Icon */
.btn-flower {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #fff9c4 20%, #f48fb1 90%);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn-flower::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px;
    background: #ffeb3b;
    border-radius: 50%;
}

@keyframes spinAndFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(90deg); }
    50% { transform: translateY(-8px) rotate(180deg); }
    75% { transform: translateY(-6px) rotate(270deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

@keyframes spinAndFloatHover {
    0% { transform: translateY(0px) rotate(0deg) scale(1.15); }
    25% { transform: translateY(-6px) rotate(90deg) scale(1.15); }
    50% { transform: translateY(-8px) rotate(180deg) scale(1.15); }
    75% { transform: translateY(-6px) rotate(270deg) scale(1.15); }
    100% { transform: translateY(0px) rotate(360deg) scale(1.15); }
}

/* --- CONTROL PANEL --- */
#controls {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 280px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    color: #ddd;
    font-size: 12px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 9999;
    pointer-events: auto;
    
    /* Hidden state */
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#controls.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar styling */
#controls::-webkit-scrollbar { width: 6px; }
#controls::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 3px;}
#controls::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px;}

.control-group {
    margin-bottom: 15px;
    border-bottom: none;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}

.control-group:nth-of-type(even) {
    background: rgba(255,255,255,0.06);
}

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

.control-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 600;
    color: #ccc;
}

.palette-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: #4caf50;
}

/* Dual Range Slider */
.dual-range {
    position: relative;
    height: 30px;
    margin: 5px 0 10px 0;
}

.dual-range-track {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    z-index: 1;
}

.dual-range-fill {
    position: absolute;
    top: 12px;
    height: 6px;
    background: linear-gradient(to right, #4caf50, #81c784);
    border-radius: 3px;
    z-index: 2;
}

.dual-range input[type=range] {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 12px;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    z-index: 3;
    margin: 0;
    padding: 0;
}

.dual-range input[type=range]::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.dual-range input[type=range]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4caf50;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    margin-top: -6px;
}

.dual-range input[type=range]::-moz-range-track {
    height: 6px;
    background: transparent;
}

.dual-range input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4caf50;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

input[type=color] {
    border: none;
    height: 25px;
    cursor: pointer;
    background: none;
    padding: 0;
    display: block;
    border-radius: 4px;
}

/* Specific rule for single color inputs to be full width */
.control-group > input[type=color] {
    width: 100%;
}

/* Specific rule for palette inputs to share space */
.palette-row input[type=color] {
    flex: 1;
    min-width: 0;
}

select {
    width: 100%;
    background: rgba(255,255,255,0.1);
    color: #eee;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}

select:focus { 
    outline: none; 
    border-color: #4caf50; 
}

button {
    width: 100%;
    padding: 10px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

button:hover {
    background: #43a047;
}

#btn-import { 
    background: #ff9800; 
}

#btn-import:hover { 
    background: #f57c00; 
}

.val-display {
    color: #81c784;
    font-family: monospace;
}

h3 { 
    margin: 0 0 12px 0; 
    color: #fff; 
    font-size: 13px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
}

h4 {
    margin: 0 0 8px 0;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}
