/* Copyright © 2025 Richard Crane */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #050505; /* Very dark background for bokeh effect */
    overflow: hidden; /* Prevent scrollbars */
    font-family: sans-serif;
}

#canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}

#bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #050505;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
    /* Add blur to simulate depth of field */
    filter: blur(2px); 
    /* slightly scale up to hide blurred edges */
    transform: scale(1.02); 
}

/* Add a vignette overlay */
#bg-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

#ui-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to canvas */
    transition: opacity 0.5s ease;
    opacity: 1;
}

#ui-layer.hidden {
    opacity: 0;
}

/* Settings Button */
#settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    pointer-events: auto; /* Re-enable clicks */
    transition: background 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn {
    position: absolute;
    top: 20px;
    right: 70px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    pointer-events: auto;
    transition: background 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

#settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Glassmorphism Side Panel */
#theme-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
}

#theme-panel.panel-hidden {
    transform: translateX(100%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.panel-header h3 {
    color: white;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.1rem;
}

#close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

#close-btn:hover {
    color: white;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.panel-content::-webkit-scrollbar {
    display: none;
}

.panel-section {
    margin-bottom: 25px;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.collapsible-header:hover {
    color: white;
}

.chevron {
    transition: transform 0.3s ease;
}

/* When collapsed, rotate the chevron -90deg (pointing right) */
.collapsible-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.section-content {
    max-height: 2000px; /* Arbitrary large height for transition */
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Theme Buttons */
.theme-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
}

.theme-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Controls */
.control-group {
    padding: 10px 0;
}

.control-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

input[type=range] {
    width: 100%;
    background: transparent;
    -webkit-appearance: none;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox styles for range */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

input[type=range]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Theme categories */
.theme-category {
    margin-bottom: 14px;
}

.theme-category-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 8px 0;
}
/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 15px 0;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgba(255, 255, 255, 0.8);
}

.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
}

.version-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: monospace;
    letter-spacing: 0.5px;
}
