/* CSS Button Generator Custom Styles */

/* Button Style Selection */
.style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 5rem;
}

.style-btn:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.style-btn.active {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.style-btn span {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Preset Buttons */
.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.preset-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.preset-preview {
    width: 100%;
    height: 2rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.preset-name {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
}

/* Preview Background Buttons */
.preview-bg-btn {
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.preview-bg-btn:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.preview-bg-btn.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* CSS Output Tabs */
.css-tab {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.css-tab:hover {
    color: #374151;
}

.css-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* CSS Output Container */
.css-output-container {
    position: relative;
}

.css-output {
    display: none;
}

.css-output.active {
    display: block;
}

.css-output pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.5;
    max-height: 300px;
    margin: 0;
}

.css-output code {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    background-color: #374151;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    z-index: 10;
}

.copy-btn:hover {
    background-color: #4b5563;
}

.copy-btn.copied {
    background-color: #10b981;
}

/* Preview Container Backgrounds */
#previewContainer.bg-white {
    background-color: #ffffff;
}

#previewContainer.bg-light {
    background-color: #f3f4f6;
}

#previewContainer.bg-dark {
    background-color: #1f2937;
}

#previewContainer.bg-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

/* Preview Size Classes */
#previewContainer.preview-mobile {
    max-width: 320px;
    margin: 0 auto;
}

#previewContainer.preview-tablet {
    max-width: 768px;
    margin: 0 auto;
}

#previewContainer.preview-desktop {
    max-width: 1024px;
    margin: 0 auto;
}

/* Color Input Styling */
input[type="color"] {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 0.25rem;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0.25rem;
}

/* Custom Range Sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 2rem;
}

.fullscreen-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 3rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.close-fullscreen-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s ease-in-out;
}

.close-fullscreen-btn:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.fullscreen-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 2rem;
}

/* Color Variations */
.color-variation {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
}

.color-variation:hover {
    transform: scale(1.1);
    border-color: #3b82f6;
}

/* Accessibility Indicators */
.accessibility-good {
    color: #10b981;
}

.accessibility-warning {
    color: #f59e0b;
}

.accessibility-error {
    color: #ef4444;
}

/* Button States Visual Feedback */
.generated-button {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

/* Loading Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Hover Effects for Style Buttons */
.style-btn svg {
    transition: all 0.2s ease-in-out;
}

.style-btn:hover svg {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .style-btn {
        padding: 0.75rem;
        min-height: 4rem;
    }

    .preset-btn {
        padding: 0.5rem;
    }

    .fullscreen-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

@media (max-width: 640px) {
    .css-output pre {
        font-size: 0.75rem;
        max-height: 200px;
    }

    .copy-btn {
        position: static;
        margin-top: 0.5rem;
        width: 100%;
    }

    .css-output-container {
        position: static;
    }
}

/* Animation Classes for Generated Buttons */
.generated-button.animate-bounce:hover {
    animation: button-bounce 0.6s ease;
}

.generated-button.animate-pulse:hover {
    animation: button-pulse 0.6s ease;
}

.generated-button.animate-shake:hover {
    animation: button-shake 0.5s ease;
}

.generated-button.animate-scale:hover {
    transform: scale(1.05);
}

.generated-button.animate-rotate:hover {
    transform: rotate(2deg);
}

.generated-button.animate-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Button Keyframes */
@keyframes button-bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

@keyframes button-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes button-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

/* Focus States */
.generated-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .fullscreen-modal {
        display: none !important;
    }

    .css-output pre {
        background-color: #f9fafb !important;
        color: #111827 !important;
        border: 1px solid #d1d5db;
    }

    .copy-btn {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .style-btn {
        border-width: 3px;
    }

    .style-btn.active {
        border-width: 4px;
    }

    .css-output pre {
        border: 2px solid #374151;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .generated-button,
    .style-btn,
    .preset-btn,
    .preview-bg-btn,
    .copy-btn {
        transition: none;
    }

    .generated-button.animate-bounce:hover,
    .generated-button.animate-pulse:hover,
    .generated-button.animate-shake:hover {
        animation: none;
    }

    .generated-button.animate-scale:hover,
    .generated-button.animate-rotate:hover {
        transform: none;
    }
}
