/* Custom Scrollbar for Sidebar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 20px;
}

/* Range Slider Reset */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    margin-top: -4px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    transition: all 0.2s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #334155;
    border-radius: 4px;
}

/* Form Inputs - Fixed for CDN */
.input-select {
    width: 100%;
    /* Dark Background (Slate 900) */
    background-color: #111827; 
    /* Soft White Text */
    color: #e2e8f0; 
    /* Subtle Border */
    border: 1px solid #334155; 
    border-radius: 0.5rem; /* 8px */
    padding: 0.625rem; /* 10px */
    font-size: 0.875rem; /* 14px */
    outline: none;
    
    /* CRITICAL: Removes the ugly default browser white box */
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Custom Dropdown Arrow (Grey) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Space for the arrow */
    
    transition: all 0.2s ease;
}

/* Hover Effect */
.input-select:hover {
    border-color: #64748b; /* Lighter border on hover */
    background-color: #1e293b; /* Slightly lighter background */
}

/* Focus Effect (When clicked) */
.input-select:focus {
    border-color: #3b82f6; /* Blue border */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* Blue glow */
}

/* The dropdown menu options */
.input-select option {
    background-color: #1e293b;
    color: #fff;
    padding: 10px;
}

/* Checkerboard Background for Transparency */
.checkerboard-bg {
    background-color: #1e1e1e;
    background-image: 
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%), 
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%), 
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Dot Pattern for Main Stage */
.bg-dot-pattern {
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Active Drag State */
.upload-zone.active .content {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Toast Animation */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast {
    animation: slideIn 0.3s ease-out forwards;
}

/* Gallery Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Individual Preset Item */
.preset-item {
    aspect-ratio: 16/9;
    border-radius: 0.5rem;
    border: 2px solid #334155;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.preset-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.preset-item:hover {
    border-color: #64748b;
}

.preset-item:hover img {
    transform: scale(1.1);
}

/* Selected State */
.preset-item.selected {
    border-color: #3b82f6; /* Blue border */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.preset-item.selected::after {
    content: '\f00c'; /* FontAwesome Checkmark */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #3b82f6;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}