 :root {
     --bg-color: #0a0a1f;
     --panel-bg: rgba(20, 20, 40, 0.95);
     --accent-color: #4a9eff;
     --text-color: #fff;
     --border-radius: 12px;
     --spacing: 15px;
 }

 body {
     background-color: var(--bg-color);
     background-image:
         radial-gradient(circle at 20% 30%, rgba(74, 158, 255, 0.05) 0%, transparent 50%),
         radial-gradient(circle at 80% 70%, rgba(74, 158, 255, 0.05) 0%, transparent 50%);
     color: var(--text-color);
     font-family: 'Space Grotesk', sans-serif;
     margin: 0;
     min-height: 100vh;
     padding: var(--spacing);
     box-sizing: border-box;
     overflow: hidden;
 }

/* Mobile Layout */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: auto;
    }
}

.container {
     display: flex;
     gap: var(--spacing);
     width: min(95vw, 1600px);
     height: min(93vh, 925px);
     margin: 0 auto;
     max-height: 925px;
 }

@media screen and (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        height: auto;
        max-height: none;
        gap: 10px;
    }
}

.left-controls-container {
     display: flex;
     flex-direction: column;
     gap: var(--spacing);
     width: min(250px, 20vw);
     height: 96vh;
     min-width: 250px;
     overflow: auto;
     padding-right: 10px;
}

/* WebKit scrollbar styling for left controls */
.left-controls-container::-webkit-scrollbar {
    width: 8px;
}

.left-controls-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.left-controls-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

/* Firefox scrollbar styling for left controls */
.left-controls-container {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.1);
}

.left-controls-container .control-section {
     background: var(--panel-bg);
     border-radius: var(--border-radius);
     border: 1px solid rgba(74, 158, 255, 0.1);
}

.left-controls-container .preset-buttons {
     display: grid;
     grid-template-columns: repeat(2, 1fr);
     gap: 8px;
     margin-bottom: 0;
}

.left-controls-container .preset-buttons button {
     justify-content: flex-start;
}

 .canvas-container {
     flex: 1;
     display: flex;
     justify-content: center;
     align-items: center;
     background: var(--panel-bg);
     border-radius: var(--border-radius);
     border: 1px solid rgba(74, 158, 255, 0.1);
     padding: var(--spacing);
     position: relative;
     overflow: hidden;
     height: 100%;
     min-width: 0;
 }

.controls-container {
     display: flex;
     flex-direction: column;
     gap: var(--spacing);
     width: min(320px, 30vw);
     height: 96vh;
     min-width: 300px;
 }

.controls-scroll {
     flex: 1;
     overflow: auto;
     padding-right: 8px;
     display: flex;
     flex-direction: column;
     gap: var(--spacing);
     max-height: calc(95vh - 80px);
 }

 .controls-scroll::-webkit-scrollbar {
     width: 8px;
 }

 .controls-scroll::-webkit-scrollbar-track {
     background: rgba(0, 0, 0, 0.1);
     border-radius: 4px;
 }

 .controls-scroll::-webkit-scrollbar-thumb {
     background: var(--accent-color);
     border-radius: 4px;
 }

 /* Firefox scrollbar styling */
 .controls-scroll {
     scrollbar-width: thin;
     scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.1);
 }

 .control-section {
     background: var(--panel-bg);
     border-radius: var(--border-radius);
     border: 1px solid rgba(74, 158, 255, 0.1);
 }

 .section-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: var(--spacing);
     cursor: pointer;
     user-select: none;
 }

 .section-content {
     padding: 0 var(--spacing) var(--spacing);
 }

 .section-header .collapse-btn {
     padding: 4px;
     background: none;
     border: none;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: transform 0.3s ease;
 }

 .section-header .collapse-btn .material-icons {
     font-size: 24px;
     color: var(--accent-color);
 }

 .control-section.collapsed .section-content {
     display: none;
 }

 .control-section.collapsed .collapse-btn {
     transform: rotate(180deg);
 }

 #colorList {
     display: flex;
     flex-direction: column;
     gap: 10px;
     margin-bottom: 15px;
 }

 .color-entry {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .color-entry input[type="number"] {
     width: 70px;
 }

 .color-entry input[type="color"] {
     width: 200px;
     height: 40px;
     padding: 0;
     border: solid 2px grey;
     border-radius:4px;
     background: none;
     cursor: pointer;
 }

 .color-entry input[type="color"]::-webkit-color-swatch-wrapper {
     padding: 0;
 }

 .color-entry input[type="color"]::-webkit-color-swatch {
     border: 1px solid rgba(74, 158, 255, 0.2);
     border-radius: 4px;
 }

 .remove-color {
     background: none;
     border: none;
     color: #ff4444;
     cursor: pointer;
     padding: 4px;
 }

 .remove-color:hover {
     background: rgba(255, 68, 68, 0.1);
 }

 h1 {
     font-size: 1.8em;
     margin: 0;
     text-align: center;
     color: var(--accent-color);
     text-transform: uppercase;
     letter-spacing: 2px;
     font-weight: 700;
 }

 /* Page header styling */
 .page-header {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 15px;
     padding: 10px 0;
 }

.header-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-link:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.header-link .material-icons {
    font-size: 0.9rem;
}

 .return-link {
     color: var(--accent-color);
     text-decoration: none;
     display: flex;
     align-items: center;
     gap: 8px;
     font-size: 0.9em;
     font-weight: 500;
     padding: 8px 12px;
     border-radius: var(--border-radius);
     transition: all 0.3s ease;
     text-transform: lowercase;
     letter-spacing: 1px;
 }

 .return-link img {
    height: 40px;
 }

 .return-link:hover {
     color: var(--text-color);
     transform: translateX(-2px);
 }

 .return-link .material-icons {
     font-size: 18px;
     transition: transform 0.3s ease;
 }

 .return-link:hover .material-icons {
     transform: translateX(-2px);
 }

 .page-header h1 {
     margin: 0;
     text-align: right;
 }

 .top-controls {
     display: flex;
     gap: 8px;
     flex-wrap: wrap;
     justify-content: center;
     border: 1px solid rgba(74, 158, 255, 0.1);
     border-radius: var(--border-radius);
     margin-bottom: var(--spacing);
     padding: 10px;
     background: var(--panel-bg);
 }

 .auto-regen-toggle {
     display: flex;
     align-items: center;
     gap: 6px;
     padding: 8px 12px;
     background: rgba(74, 158, 255, 0.1);
     border: 1px solid rgba(74, 158, 255, 0.3);
     border-radius: 8px;
     cursor: pointer;
     transition: all 0.2s ease;
     font-size: 14px;
     font-weight: 500;
 }

 .auto-regen-toggle:hover {
     background: rgba(74, 158, 255, 0.15);
     border-color: rgba(74, 158, 255, 0.5);
 }

 .auto-regen-toggle input[type="checkbox"] {
     margin: 0;
     cursor: pointer;
 }

 .auto-regen-toggle .material-icons {
     font-size: 18px;
     color: var(--accent-color);
 }

 .auto-regen-toggle input:checked + .material-icons {
     color: #4CAF50;
 }

 .auto-regen-toggle input:not(:checked) + .material-icons {
     color: #ff6b6b;
 }

 #resetAll {
     padding: 10px 20px;
     font-weight: 600;
     background: rgba(255, 68, 68, 0.1);
     border: 1px solid rgba(255, 68, 68, 0.2);
     display: flex;
     align-items: center;
     gap: 8px;
 }

 #resetAll:hover {
     background: rgba(255, 68, 68, 0.2);
     border-color: rgba(255, 68, 68, 0.3);
 }

 #randomSeed {
     padding: 10px 20px;
     font-weight: 600;
     background: rgba(74, 158, 255, 0.1);
     border: 1px solid rgba(74, 158, 255, 0.2);
 }

 #randomSeed:hover {
     background: rgba(74, 158, 255, 0.2);
     border-color: rgba(74, 158, 255, 0.3);
 }

 #generate, #export {
     padding: 10px 20px;
     font-weight: 600;
     width: 145px;
 }

 #exportSpriteSheet{
    width: 200px;
 }

 #controls,
 #zoomControls {
     background: var(--panel-bg);

     border-radius: var(--border-radius);
     text-align: left;
     position: relative;
     backdrop-filter: blur(10px);
     border: 1px solid rgba(74, 158, 255, 0.1);
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
         0 1px 3px rgba(0, 0, 0, 0.1);
 }

 .loading {
     position: absolute;
     top: 15px;
     right: 15px;
     width: 24px;
     height: 24px;
     border-radius: 50%;
     border: 2px solid transparent;
     border-top-color: var(--accent-color);
     display: none;
     z-index: 100;
     animation: spin 1s linear infinite;
 }

 @keyframes spin {
     0% { transform: rotate(0deg); }
     100% { transform: rotate(360deg); }
 }

 .section-title {
     font-size: 0.9em;
     text-transform: uppercase;
     letter-spacing: 1px;
     color: var(--accent-color);
     margin-bottom: 15px;
     font-weight: 600;
 }


 .action-buttons {
     display: flex;
     gap: 8px;
     justify-content: center;
     margin: 15px 0 5px;
     flex-wrap: wrap;
 }

 .section-random,
 .section-reset {
     flex: 1;
     min-width: 100px;
     justify-content: center;
 }

 .section-random {
     background: rgba(74, 158, 255, 0.1);
     border-color: rgba(74, 158, 255, 0.2);
 }

 .section-random:hover {
     background: rgba(74, 158, 255, 0.2);
     border-color: rgba(74, 158, 255, 0.3);
 }

 .section-reset {
     background: rgba(255, 68, 68, 0.1);
     border-color: rgba(255, 68, 68, 0.2);
 }

 .section-reset:hover {
     background: rgba(255, 68, 68, 0.2);
     border-color: rgba(255, 68, 68, 0.3);
 }

 .debris-reset {
     background: rgba(255, 68, 68, 0.1);
     border-color: rgba(255, 68, 68, 0.2);
 }

 .debris-reset:hover {
     background: rgba(255, 68, 68, 0.2);
     border-color: rgba(255, 68, 68, 0.3);
 }


 button {
     background: rgba(74, 158, 255, 0.1);
     border: 1px solid rgba(74, 158, 255, 0.2);
     color: var(--text-color);
     padding: 8px 12px;
     border-radius: 6px;
     cursor: pointer;
     font-family: 'Space Grotesk', sans-serif;
     font-size: 0.9em;
     transition: all 0.2s ease;
     display: flex;
     align-items: center;
     gap: 4px;
 }

 button:hover {
     background: rgba(74, 158, 255, 0.2);
     border-color: rgba(74, 158, 255, 0.3);
 }

 button .material-icons {
     font-size: 18px;
 }

 .preset-buttons {
     display: grid;
     grid-template-columns: repeat(2, 1fr);
     gap: 8px;
     margin-bottom: 15px;
 }

 .tooltip {
     position: relative;
     display: inline-block;
 }

 .tooltip .tooltiptext {
     visibility: hidden;
     width: auto;
     background-color: var(--panel-bg);
     color: var(--text-color);
     text-align: center;
     border-radius: var(--border-radius);
     padding: 8px;
     position: absolute;
     z-index: 500;
     bottom: 125%;
     margin-left: -90px;
     opacity: 0;
     transition: opacity 0.3s;
     font-size: 0.8em;
     border: 1px solid rgba(74, 158, 255, 0.1);
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 }

 .tooltip:hover .tooltiptext {
     visibility: visible;
     opacity: 1;
 }

 label {
     display: block;
     margin: 15px 0;
     font-size: 0.9em;
 }

/* Collapsible sections with slide-in animations */
.control-section {
    transition: all 0.3s ease;
}

.control-section .section-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.control-section .section-header:hover {
    background: rgba(74, 158, 255, 0.05);
    border-radius: 8px;
}

/* Default expanded state */
.control-section .section-content {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 2000px;
    padding: 0 var(--spacing) var(--spacing);
}

.control-section .section-content > * {
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.control-section .section-content > *:nth-child(odd) {
    transition-delay: 0.05s;
}

.control-section .section-content > *:nth-child(even) {
    transition-delay: 0.1s;
}

/* Collapsed state */
.control-section.collapsed .section-content {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-section.collapsed .section-content > * {
    transform: translateX(-20px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.control-section.collapsed .section-content > *:nth-child(even) {
    transform: translateX(20px);
}

/* Reset transition delays for collapsed state */
.control-section.collapsed .section-content > *:nth-child(odd),
.control-section.collapsed .section-content > *:nth-child(even) {
    transition-delay: 0s;
}

.control-section .collapse-btn {
    transition: transform 0.3s ease;
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
}

.control-section.collapsed .collapse-btn {
    transform: rotate(0deg);
}

.control-section:not(.collapsed) .collapse-btn {
    transform: rotate(180deg);
}

/* Planet Generator Section Animations - Flexbox styling for consistent layout */
#generationMode .section-content,
#controls .section-content,
#colorControls .section-content,
#cloudControls .section-content,
#animationControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Left side controls for planet generator - generic styling for sections without specific IDs */
.left-controls-container .control-section .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

 input[type="range"] {
     width: 100%;
     margin: 8px 0;
     accent-color: var(--accent-color);
     height: 6px;
     background: rgba(255, 255, 255, 0.1);
     border-radius: 3px;
     outline: none;
     cursor: pointer;
     -webkit-appearance: none;
     appearance: none;
 }

 /* WebKit slider thumb styling */
 input[type="range"]::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 18px;
     height: 18px;
     border-radius: 50%;
     background: var(--accent-color);
     cursor: pointer;
     border: 2px solid var(--panel-bg);
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
     transition: all 0.2s ease;
 }

 input[type="range"]::-webkit-slider-thumb:hover {
     transform: scale(1.1);
     box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
 }

 /* Mozilla slider thumb styling */
 input[type="range"]::-moz-range-thumb {
     width: 18px;
     height: 18px;
     border-radius: 50%;
     background: var(--accent-color);
     cursor: pointer;
     border: 2px solid var(--panel-bg);
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
     transition: all 0.2s ease;
 }

 input[type="range"]::-moz-range-thumb:hover {
     transform: scale(1.1);
     box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
 }

 /* Mozilla slider track styling */
 input[type="range"]::-moz-range-track {
     height: 6px;
     background: rgba(255, 255, 255, 0.1);
     border-radius: 3px;
     border: none;
 }

 input[type="number"] {
     background: rgba(255, 255, 255, 0.05);
     border: 1px solid rgba(74, 158, 255, 0.2);
     color: var(--text-color);
     padding: 8px;
     border-radius: 4px;
     width: 100%;
     box-sizing: border-box;
     font-family: 'Space Grotesk', sans-serif;
 }

 input[type="number"]:focus {
     outline: none;
     border-color: var(--accent-color);
 }

 /* Custom checkbox styling */
 input[type="checkbox"] {
     appearance: none;
     -webkit-appearance: none;
     width: 18px;
     height: 18px;
     border: 2px solid rgba(74, 158, 255, 0.3);
     border-radius: 4px;
     background: rgba(255, 255, 255, 0.05);
     cursor: pointer;
     position: relative;
     margin: 0 8px 0 0;
     transition: all 0.2s ease;
     flex-shrink: 0;
 }

 input[type="checkbox"]:hover {
     border-color: rgba(74, 158, 255, 0.5);
     background: rgba(74, 158, 255, 0.1);
 }

 input[type="checkbox"]:checked {
     background: var(--accent-color);
     border-color: var(--accent-color);
 }

 input[type="checkbox"]:checked::before {
     content: '✓';
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     color: var(--bg-color);
     font-size: 12px;
     font-weight: bold;
 }

 input[type="checkbox"]:focus {
     outline: none;
     box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
 }

 /* Custom radio button styling */
 input[type="radio"] {
     appearance: none;
     -webkit-appearance: none;
     width: 18px;
     height: 18px;
     border: 2px solid rgba(74, 158, 255, 0.3);
     border-radius: 50%;
     background: rgba(255, 255, 255, 0.05);
     cursor: pointer;
     position: relative;
     margin: 0 8px 0 0;
     transition: all 0.2s ease;
     flex-shrink: 0;
 }

 input[type="radio"]:hover {
     border-color: rgba(74, 158, 255, 0.5);
     background: rgba(74, 158, 255, 0.1);
 }

 input[type="radio"]:checked {
     border-color: var(--accent-color);
     background: rgba(74, 158, 255, 0.1);
 }

 input[type="radio"]:checked::before {
     content: '';
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 8px;
     height: 8px;
     border-radius: 50%;
     background: var(--accent-color);
 }

 input[type="radio"]:focus {
     outline: none;
     box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
 }

 .radio-group,
 .checkbox-group {
     display: flex;
     flex-direction: column;
     gap: 8px;
     margin-top: 8px;
 }

 .radio-option,
 .checkbox-option {
     display: flex;
     align-items: center;
     gap: 8px;
     margin: 0;
     cursor: pointer;
     padding: 8px;
     border-radius: 6px;
     transition: all 0.2s ease;
     border: 1px solid transparent;
 }

 .radio-option:hover,
 .checkbox-option:hover {
     background: rgba(74, 158, 255, 0.08);
     border-color: rgba(74, 158, 255, 0.1);
 }

 .radio-option input[type="radio"],
 .checkbox-option input[type="checkbox"] {
     margin: 0;
     flex-shrink: 0;
 }

 .radio-option span,
 .checkbox-option span {
     font-size: 0.9em;
     color: var(--text-color);
 }

 .value-display {
     color: var(--accent-color);
     font-weight: 500;
 }

 .mode-selector {
     display: flex;
     flex-direction: column;
     gap: 8px;
     margin-top: 8px;
 }

 .mode-selector .radio-option {
     border: 2px solid rgba(74, 158, 255, 0.2);
     border-radius: 12px;
     padding: 16px;
     transition: all 0.3s ease;
     background: rgba(255, 255, 255, 0.02);
     position: relative;
     overflow: hidden;
 }

 .mode-selector .radio-option::before {
     content: '';
     position: absolute;
     top: 0;
     left: -100%;
     width: 100%;
     height: 100%;
     background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.1), transparent);
     transition: left 0.5s ease;
 }

 .mode-selector .radio-option:hover::before {
     left: 100%;
 }

 .mode-selector .radio-option:hover {
     background: rgba(74, 158, 255, 0.1);
     border-color: rgba(74, 158, 255, 0.4);
     transform: translateY(-2px);
     box-shadow: 0 4px 12px rgba(74, 158, 255, 0.15);
 }

 .mode-selector .radio-option input[type="radio"]:checked + span.material-icons {
     color: var(--accent-color);
     text-shadow: 0 0 8px rgba(74, 158, 255, 0.5);
 }

 .mode-selector .radio-option input[type="radio"]:checked ~ span {
     color: var(--accent-color);
     font-weight: 600;
 }

 .mode-selector .radio-option:has(input[type="radio"]:checked) {
     background: rgba(74, 158, 255, 0.15);
     border-color: var(--accent-color);
     box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.3), 0 4px 12px rgba(74, 158, 255, 0.2);
 }

 .mode-selector .radio-option .material-icons {
     font-size: 24px;
     transition: all 0.3s ease;
 }

 .mode-selector .radio-option span:not(.material-icons) {
     font-size: 1em;
     font-weight: 500;
     transition: all 0.3s ease;
 }

 .input-group {
     display: flex;
     align-items: center;
     gap: 8px;
     width: 100%;
 }

 .value-input {
     width: 70px !important;
     padding: 4px 8px;
     text-align: left;
     font-size: 0.9em;
     margin: 0px;
 }

 .icon-button {
     padding: 6px;
     height: 32px;
     width: 32px;
     min-width: 32px;
     display: flex;
     align-items: center;
     justify-content: center;
 }

.icon-button .material-icons {
    font-size: 18px;
}

.icon-button.locked {
    background-color: #2a2a2a;
    color: #666;
}

input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

 #planetCanvas {
     image-rendering: pixelated;
     /* For pixel art look */
     background: transparent;
     position: absolute;
     left: 50%;
     top: 50%;
     transform: translate(-50%, -50%);
     cursor: grab;
 }

 #planetCanvas:active {
     cursor: grabbing;
 }

/* Gallery floating action buttons */
.floating-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 90;
}

.floating-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.floating-button:hover {
    transform: scale(1.1);
    background: #5ba8ff;
}

.floating-button .material-icons {
    font-size: 24px;
}


/* Gallery modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-modal.active {
    display: flex;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.gallery-header h2 {
    color: var(--accent-color);
    margin: 0;
}

.gallery-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
}

.gallery-close:hover {
    color: var(--accent-color);
}

/* Gallery floating actions */
.gallery-floating-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 90;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

.planet-card {
    background: var(--panel-bg);
    border: 1px solid rgba(74, 158, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.planet-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.planet-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 10px;
    image-rendering: pixelated;
}

.planet-name {
    color: var(--text-color);
    font-size: 0.9em;
    text-align: center;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Planet save dialog */
.save-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(74, 158, 255, 0.1);
    z-index: 1001;
    display: none;
    width: 300px;
}

.save-dialog.active {
    display: block;
}

.save-dialog input[type="text"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 4px;
    color: var(--text-color);
    font-family: 'Space Grotesk', sans-serif;
    box-sizing: border-box;
    text-align: center;
}

.save-dialog .dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.dialog-overlay.active {
    display: block;
}

.planet-name-display {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    padding: 8px;
    border-radius: var(--border-radius);
    font-size: 0.9em;
    z-index: 10;
    display: none;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

.name-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.planet-name-text {
    margin-right: 4px;
    padding: 0 4px;
}

.close-preset {
    padding: 4px;
    height: 24px;
    width: 24px;
    min-width: 24px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-preset:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-preset .material-icons {
    font-size: 16px;
    color: var(--text-color);
}

/* Updated Gallery Card Styles */
.planet-card {
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

.planet-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
}

.thumbnail-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.thumbnail-container:hover {
    transform: scale(1.05);
}

.planet-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}

.planet-name {
    flex: 1;
    padding: 4px 0;
}

.planet-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.planet-actions .icon-button {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    padding: 4px;
    height: 28px;
    width: 28px;
    min-width: 28px;
}

.planet-actions .icon-button:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.3);
}

.planet-actions .delete-button {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.2);
}

.planet-actions .delete-button:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.3);
}

.planet-actions .material-icons {
    font-size: 16px;
}

/* Delete confirmation modal */
.delete-confirmation-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 68, 68, 0.3);
    z-index: 1002;
    display: none;
    width: 350px;
    text-align: center;
}

.delete-confirmation-modal.active {
    display: block;
}

.delete-confirmation-modal h3 {
    color: #ff4444;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.delete-confirmation-modal p {
    color: var(--text-color);
    margin: 15px 0;
    line-height: 1.4;
}

.delete-confirmation-modal .planet-name-highlight {
    color: var(--accent-color);
    font-weight: 600;
}

.delete-confirmation-modal .dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.delete-confirmation-modal .cancel-button {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    padding: 10px 20px;
}

.delete-confirmation-modal .cancel-button:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.3);
}

.delete-confirmation-modal .confirm-delete-button {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.2);
    padding: 10px 20px;
}

.delete-confirmation-modal .confirm-delete-button:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.3);
}

/* Rotation slider container */
.rotation-slider-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    pointer-events: none;
}

.rotation-controls {
    background: var(--panel-bg);
    border: 1px solid rgba(74, 158, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    min-width: 300px;
    transition: all 0.2s ease;
}

.rotation-controls:hover {
    border-color: rgba(74, 158, 255, 0.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.rotation-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: var(--text-color);
    white-space: nowrap;
    margin: 0;
}

.rotation-label .material-icons {
    font-size: 18px;
    color: var(--accent-color);
}

#rotationValue {
    color: var(--accent-color);
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

#rotationSlider {
    flex: 1;
    margin: 0;
    accent-color: var(--accent-color);
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#rotationSlider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--panel-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#rotationSlider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

#rotationSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--panel-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#resetRotation {
    padding: 6px;
    height: 32px;
    width: 32px;
    min-width: 32px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    transition: all 0.2s ease;
}

#resetRotation:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.3);
    transform: scale(1.05);
}

#resetRotation .material-icons {
    font-size: 18px;
    color: var(--accent-color);
}

/* Notification system */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9em;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

.notification.info {
    background: rgba(74, 158, 255, 0.9);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.notification.success {
    background: rgba(76, 175, 80, 0.9);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.notification.error {
    background: rgba(255, 68, 68, 0.9);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Ko-fi widget positioning */
.kofi-widget-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
}

.kofi-widget-container .donation-text{
    position: relative;
    bottom: 20px;
    background-color: var(--panel-bg);
    border: solid 2px var(--accent-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    max-width: 400px;
}

.donation-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.donation-close:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.donation-close .material-icons {
    font-size: 16px;
}

/* Canvas lock toggle button - hidden on desktop */
.canvas-lock-toggle {
    display: none;
}

/* Mobile header styling */
.mobile-header {
    display: none;
}

.mobile-header-links {
    display: none;
}

.mobile-header-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 14px;
    transition: all 0.2s ease;
}

.mobile-header-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.mobile-header-link .material-icons {
    font-size: 18px;
}

@media screen and (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex !important;
        flex-direction: column;
        order: -3;
        margin-bottom: 10px;
        gap: 10px;
    }
    
    .mobile-header-links {
        display: flex !important;
        gap: 8px;
        justify-content: center;
    }
    
    /* Hide desktop header */
    .controls-container .page-header {
        display: none;
    }
    
    /* Canvas container mobile styling */
    .canvas-container {
        order: -2;
        height: 60vh;
        min-height: 300px;
        margin-bottom: 10px;
        position: relative;
    }
    
    /* Show canvas lock toggle on mobile */
    .canvas-lock-toggle {
        display: flex;
        position: absolute;
        top: 10px;
        left: 10px;
        background: var(--panel-bg);
        border: 1px solid rgba(74, 158, 255, 0.3);
        border-radius: 50%;
        color: var(--text-color);
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.2s ease;
    }
    
    .canvas-lock-toggle:hover {
        background: rgba(74, 158, 255, 0.2);
        border-color: var(--accent-color);
    }
    
    .canvas-lock-toggle.locked {
        background: var(--accent-color);
        border-color: var(--accent-color);
    }
    
    .canvas-lock-toggle.locked .material-icons {
        content: 'lock';
    }
    
    /* Fixed canvas when locked and scrolled */
    .canvas-container.locked-floating {
        position: fixed;
        top: 80px; /* Start below mobile header */
        left: 10px;
        right: 10px;
        height: 40vh;
        min-height: 300px;
        z-index: 100;
        margin-bottom: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Add top spacing when canvas is floating to prevent overlap */
    body.canvas-floating {
        padding-top: calc(40vh + 100px); /* Header height + canvas height + margin */
    }
    
    /* Left controls mobile styling */
    .left-controls-container {
        order: -1;
        width: 100%;
        height: auto;
        min-width: unset;
        max-height: none;
        overflow: visible;
        padding-right: 0;
        margin-bottom: 10px;
    }
    
    /* Right controls mobile styling */
    .controls-container {
        order: 0;
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }
    
    /* Ko-fi widget mobile styling */
    .kofi-widget-container {
        position: static;
        order: 1;
        transform: none;
        margin-top: 20px;
        background: var(--panel-bg);
        border-radius: var(--border-radius);
        border: 1px solid rgba(74, 158, 255, 0.1);
        padding: var(--spacing);
    }
    
    .kofi-widget-container .donation-text {
        position: static;
        bottom: auto;
        background: transparent;
        border: none;
        padding: 0;
        margin-bottom: 15px;
        max-width: none;
    }
    
    /* Hide close button on mobile since donation is part of natural flow */
    .donation-close {
        display: none;
    }
    
    /* Mobile preset buttons adjustments */
    .left-controls-container .preset-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .left-controls-container .preset-buttons button {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .left-controls-container .preset-buttons .material-icons {
        font-size: 16px;
    }
    
    /* Controls scroll area mobile adjustments */
    .controls-scroll {
        max-height: none;
    }
    
    /* Floating actions mobile positioning */
    .floating-actions {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    /* Rotation slider mobile styling */
    .rotation-slider-container {
        position: absolute;
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        margin-top: 0;
        background: var(--panel-bg);
        border-radius: var(--border-radius);
        border: 1px solid rgba(74, 158, 255, 0.1);
        padding: 10px;
    }
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--panel-bg);
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    z-index: 100000000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cookie-consent.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent.hide {
    transform: translateY(100px);
    opacity: 0;
}

.cookie-consent.removed {
    display: none !important;
    pointer-events: none;
}

.cookie-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
}

.cookie-icon {
    flex-shrink: 0;
}

.cookie-icon .material-icons {
    font-size: 2rem;
    color: var(--accent-color);
}

.cookie-text {
    flex: 1;
    min-width: 0;
}

.cookie-text h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.cookie-text p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.cookie-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.cookie-links a {
    color: var(--accent-color);
    text-decoration: none;
}

.cookie-links a:hover {
    text-decoration: underline;
}

.cookie-links span {
    color: rgba(255, 255, 255, 0.5);
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-button .material-icons {
    font-size: 1rem;
}

.cookie-button.accept {
    background: var(--accent-color);
    color: white;
}

.cookie-button.accept:hover {
    background: #3a8aef;
    transform: translateY(-1px);
}

.cookie-button.decline {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-button.decline:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile cookie banner */
@media screen and (max-width: 768px) {
    .cookie-consent {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .cookie-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }
    
    .cookie-button {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
}
