/* Transition Generator Specific Styles */

/* Custom range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #7c3aed;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #7c3aed;
    transform: scale(1.1);
}

/* Preset button styling */
.preset-btn {
    padding: 8px 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.preset-btn:hover {
    border-color: #8b5cf6;
    color: #7c3aed;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    border-color: transparent;
}

/* Background option buttons */
.bg-option {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.bg-option:hover {
    transform: scale(1.1);
}

.bg-option.active {
    border-color: #8b5cf6 !important;
    border-width: 3px;
}

/* Preview container backgrounds */
.preview-container {
    transition: background 0.3s ease;
}

.preview-container.light {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

.preview-container.dark {
    background: #1f2937;
}

.preview-container.gradient {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
}

.preview-container.checker {
    background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #e5e7eb 10px, #e5e7eb 20px);
}

/* Preview element */
#previewElement {
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    transition-delay: 0s;
    will-change: auto;
}

/* State control inputs */
.state-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.state-control label {
    min-width: 80px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.state-control input,
.state-control select {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
}

.state-control .remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.state-control .remove-btn:hover {
    background: #dc2626;
}

/* Code output styling */
pre {
    font-family: "Fira Code", "Monaco", "Cascadia Code", "Roboto Mono", monospace;
    line-height: 1.5;
}

/* Syntax highlighting for CSS */
.css-property {
    color: #93c5fd;
}

.css-value {
    color: #86efac;
}

.css-selector {
    color: #fbbf24;
}

.css-comment {
    color: #6b7280;
    font-style: italic;
}

/* Performance indicators */
.performance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.performance-indicator.high {
    background: #fef2f2;
    color: #dc2626;
}

.performance-indicator.medium {
    background: #fffbeb;
    color: #d97706;
}

.performance-indicator.low {
    background: #f0fdf4;
    color: #16a34a;
}

/* Animation controls */
.animation-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.animation-controls button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Timing function visualization */
.timing-function-preview {
    width: 100%;
    height: 40px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.timing-curve {
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    width: calc(100% - 8px);
    height: 2px;
    background: #8b5cf6;
}

/* Copy feedback */
.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .preset-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .state-control {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .state-control label {
        min-width: auto;
    }

    #previewElement {
        width: 80px;
        height: 80px;
        font-size: 12px;
    }
}

/* Custom scrollbar for code blocks */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Enhanced hover effects */
.preset-btn,
.bg-option,
button {
    position: relative;
    overflow: hidden;
}

.preset-btn::before,
.bg-option::before,
button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 1;
}

.preset-btn:active::before,
.bg-option:active::before,
button:active::before {
    width: 200px;
    height: 200px;
}

/* Accessibility improvements */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Error states */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}

/* Success states */
.success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

.success-message {
    color: #059669;
    font-size: 12px;
    margin-top: 4px;
}
