/* AutoVibe Initial CSS for project 1756904677052 - Iteration 1 */

/* Basic Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Variables for easier theme management */
:root {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --accent-color: #e94560;
    --secondary-text-color: #b0b0b0;
    --panel-bg-color: #232946;
    --border-color: #4a4a68;
    --input-bg-color: #333956;
    --button-bg-color: var(--accent-color);
    --button-text-color: #fff;
    --hover-color: #ff6a80;
    --focus-outline-color: #6d597a;
}

/* Body Styling */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Full viewport height */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Header Styling */
header {
    width: 100%;
    padding: 20px;
    background-color: var(--panel-bg-color);
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

h1 {
    font-size: 2.5em;
    color: var(--accent-color);
    margin: 0;
    letter-spacing: 1px;
}

/* Main Content Layout */
main {
    display: flex;
    flex-grow: 1; /* Allow main to take up available vertical space */
    padding: 20px;
    gap: 20px; /* Space between controls and fractal view */
    width: 100%; /* Ensure main takes full width for padding */
    justify-content: center; /* Center content horizontally within main */
    align-items: stretch; /* Stretch children to fill main's height */
}

/* Control Panel Styling */
#controls-panel {
    flex-shrink: 0; /* Prevent panel from shrinking */
    width: 300px; /* Fixed width for the control panel */
    background-color: var(--panel-bg-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Enable scrolling for controls if they exceed height */
}

#controls-panel h2 {
    font-size: 1.5em;
    color: var(--accent-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 25px;
}

.control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap; /* Allow items to wrap on smaller widths */
}

.control-item label {
    font-size: 1em;
    color: var(--secondary-text-color);
    margin-right: 10px;
    min-width: 80px; /* Give labels a consistent minimum width */
}

/* Input, Select, Button Base Styles */
select,
input[type="number"],
input[type="range"] {
    width: auto;
    flex-grow: 1; /* Allow inputs to take up available space */
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus,
input[type="number"]:focus,
input[type="range"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--focus-outline-color);
}

/* Specific styles for range input */
input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: grab;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

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

input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: grab;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    border: none;
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb:active {
    cursor: grabbing;
}

input[type="range"]::-ms-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: grab;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-ms-thumb:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

input[type="range"]::-ms-thumb:active {
    cursor: grabbing;
}

/* Track for range input */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
}

input[type="range"]::-ms-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-color: transparent;
    border-width: 6px 0;
    color: transparent;
}
input[type="range"]::-ms-fill-lower {
    background: var(--border-color);
    border-radius: 5px;
}
input[type="range"]::-ms-fill-upper {
    background: var(--border-color);
    border-radius: 5px;
}

#iterations-value {
    margin-left: 10px;
    min-width: 40px;
    text-align: right;
    color: var(--accent-color);
    font-weight: bold;
}

/* Button Styling */
button {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    outline: none;
}

button:hover {
    background-color: var(--hover-color);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:focus-visible {
    box-shadow: 0 0 0 2px var(--focus-outline-color);
}

/* Fractal View Styling */
#fractal-view {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: 300px; /* Ensure fractal view has a minimum height */
}

#fractal-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background-color: #000;
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    padding: 15px 25px;
    border-radius: 5px;
    font-size: 1.2em;
    z-index: 5;
    white-space: nowrap;
}

/* Footer Styling */
footer {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--panel-bg-color);
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.9em;
    margin-top: auto; /* Push footer to the bottom */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

footer p {
    margin: 0;
    color: inherit;
}

/* Basic responsiveness */
@media (max-width: 1024px) {
    main {
        flex-direction: column; /* Stack controls and fractal view vertically */
        padding: 15px;
        gap: 15px;
    }

    #controls-panel {
        width: 100%; /* Full width for controls */
        max-height: 40vh; /* Limit height to prevent taking up too much vertical space */
        padding: 15px;
    }

    #controls-panel h2 {
        font-size: 1.3em;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .control-item label {
        min-width: 60px;
    }

    h1 {
        font-size: 2em;
    }

    header {
        padding: 15px;
    }

    footer {
        padding: 10px 15px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    /* Paragraph styling (for general paragraphs, though only footer p is used) */
    p {
        font-size: 0.9em;
        padding: 0 10px;
    }

    select,
    input[type="number"],
    button {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .control-item {
        flex-direction: column; /* Stack label and input/control */
        align-items: flex-start;
        margin-bottom: 10px;
    }

    .control-item label {
        margin-bottom: 5px;
        margin-right: 0;
    }

    select,
    input[type="number"],
    input[type="range"] {
        width: 100%; /* Make inputs full width */
    }

    #iterations-value {
        width: 100%;
        text-align: left;
        margin-left: 0;
        margin-top: 5px;
    }

    button {
        width: 100%; /* Make buttons full width */
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    header, footer {
        padding: 10px;
    }

    main {
        padding: 10px;
        gap: 10px;
    }

    #controls-panel {
        padding: 10px;
    }

    #controls-panel h2 {
        font-size: 1.2em;
    }
}