/* Animations */
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.8); }
    100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.5); }
}

/* Slide-in animations */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Floating animation */
.floating {
    animation: float 2s ease-in-out infinite;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}

/* Glowing button effect */
.glowing {
    background: linear-gradient(to right, #4f46e5, #06b6d4);
    animation: glow 2s ease-in-out infinite;
}

/* Tab navigation styles */
.active {
    color: #4f46e5;
    border-bottom: 2px solid #4f46e5;
}

/* Tab panel transition */
.tab-panel-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-panel-transition:not(.showing) {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.tab-panel-transition.showing {
    opacity: 1;
    transform: translateY(0);
}

/* Back to top button */
#back-to-top.show {
    opacity: 1;
    display: block;
}

/* Error message */
#error-message.show {
    display: block;
}

/* Preview container */
#preview-container {
    background: linear-gradient(45deg, #4c51bf, #2dd4bf); /* Contrasting background for glass effect */
    padding: 10px;
    border-radius: 8px;
    min-height: 64px; /* Ensure minimum height for visibility */
}

/* Blob Shape */
.blob-shape {
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

/* CSS and HTML code blocks */
#css-output, #html-output {
    max-height: 200px;
}

#css-code, #html-code {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Custom Range Slider */
.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #e0e7ff 0%, #e0e7ff 50%, #e5e7eb 50%, #e5e7eb 100%);
    border-radius: 4px;
    outline: none;
    transition: background 0.3s ease;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #4f46e5;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #4f46e5;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-range:hover::-webkit-slider-thumb,
.custom-range:hover::-moz-range-thumb {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.custom-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: transparent;
    border-radius: 4px;
}

.custom-range::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: transparent;
    border-radius: 4px;
}

/* Dynamic fill for range slider */
.custom-range {
    background: linear-gradient(to right, #4f46e5 var(--range-progress), #e5e7eb var(--range-progress));
}

/* Color Picker */
.color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}