/* Background Generator Specific Styles */
:root {
    --card-bg: rgba(20, 20, 40, 0.95);
}


/* Background type selector */
.background-type-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.background-type-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;
}

.background-type-selector .radio-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(74, 158, 255, 0.1);
}

.background-type-selector .radio-option.disabled input[type="radio"] {
    cursor: not-allowed;
}

.background-type-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;
}

.background-type-selector .radio-option:not(.disabled):hover::before {
    left: 100%;
}

.background-type-selector .radio-option:not(.disabled):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);
}

.background-type-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);
}

.background-type-selector .radio-option input[type="radio"]:checked ~ span {
    color: var(--accent-color);
    font-weight: 600;
}

.background-type-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);
}

.background-type-selector .radio-option .material-icons {
    font-size: 24px;
    transition: all 0.3s ease;
}

.background-type-selector .radio-option span:not(.material-icons) {
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Background canvas specific styling */
#backgroundCanvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: transparent;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#backgroundCanvas:active {
    cursor: grabbing;
}

/* Nebula-specific controls styling */
#nebulaControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Color entries for background generator */
.color-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.threshold-input {
    width: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(74, 158, 255, 0.2);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9em;
}

.threshold-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.color-entry input[type="color"] {
    width: 200px;
    height: 40px;
    padding: 0;
    border: solid 2px rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-entry input[type="color"]:hover {
    border-color: rgba(74, 158, 255, 0.4);
    transform: scale(1.02);
}

.color-entry input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
    border-radius: 6px;
}

.color-entry input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Canvas settings panel */
#canvasSettings .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#applyCanvasSize {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.2);
}

#applyCanvasSize:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
}

/* Effects controls */
#effectsControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Voronoi controls */
#voronoiControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Star controls */
#starControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Star color controls */
#starColorControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Color controls */
#colorControls .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Left side controls - generic styling for sections without specific IDs */
.left-controls-container .control-section .section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Gallery modifications for backgrounds */
.background-name-highlight {
    color: var(--accent-color);
    font-weight: 600;
}

/* Loading state for background generation */
.generating {
    pointer-events: none;
    opacity: 0.7;
}

.generating .loading {
    display: block;
}

/* Responsive adjustments for background generator */
@media (max-width: 1200px) {
    .background-type-selector .radio-option {
        padding: 12px;
    }
    
    .background-type-selector .radio-option .material-icons {
        font-size: 20px;
    }
    
    .color-entry input[type="color"] {
        width: 150px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    #backgroundCanvas {
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .background-type-selector {
        gap: 6px;
    }
    
    .background-type-selector .radio-option {
        padding: 10px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .color-entry {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .color-entry input[type="color"] {
        width: 100%;
    }
}

/* Animation for nebula generation */
@keyframes nebulaGenerate {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.nebula-generating #backgroundCanvas {
    animation: nebulaGenerate 1s ease-out;
}

/* Gallery improvements for background generator */
.planet-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.planet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 158, 255, 0.2);
}

.planet-thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
}

.thumbnail-container {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

/* Ensure select dropdowns match the theme */
select {
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid rgba(74, 158, 255, 0.2);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

select:hover {
    border-color: rgba(74, 158, 255, 0.4);
}

select option {
    background: var(--card-bg);
    color: var(--text-color);
}


/* Preset controls styling */
.preset-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(74, 158, 255, 0.1);
}

.preset-controls label {
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.preset-controls select {
    min-width: 150px;
}

/* Special styling for disabled future features */
.disabled span {
    color: rgba(255, 255, 255, 0.4) !important;
}

.disabled .material-icons {
    color: rgba(74, 158, 255, 0.3) !important;
}