/* CSS Text Shadow Generator Custom Styles */

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.btn-outline {
    background: white;
    color: #6b7280;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
}

.btn-outline:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Preview Container Styling */
.preview-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.preview-container.dark-bg {
    background: #1f2937;
}

.preview-container.light-bg {
    background: #ffffff;
}

.preview-container.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-container.image-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="25" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

/* Preview Element */
#previewElement {
    transition: all 0.2s ease;
    cursor: default;
    user-select: none;
    position: relative;
    z-index: 1;
    line-height: 1.1;
    word-break: break-word;
    max-width: 100%;
}

/* Background Pattern Buttons */
.bg-pattern-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.bg-pattern-btn:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.bg-pattern-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Shadow Layer Controls */
.shadow-layer {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.shadow-layer:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.shadow-layer.active {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.shadow-layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.shadow-layer-toggle {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    flex: 1;
}

.shadow-layer-actions {
    display: flex;
    gap: 0.5rem;
}

.layer-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.layer-action-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8fafc;
    transform: scale(1.05);
}

.layer-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.layer-duplicate-btn:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

.layer-delete-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Control Groups */
.control-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.control-item {
    display: flex;
    flex-direction: column;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Range Input Styling */
.range-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.control-input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.control-input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}

.control-input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.range-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 3rem;
    text-align: right;
}

/* Color Input Styling */
.control-input[type="color"] {
    width: 48px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: none;
}

.control-input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Text Inputs */
.control-input[type="text"],
.control-input[type="number"] {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.control-input[type="text"]:focus,
.control-input[type="number"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Preset Buttons */
.preset-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 100px;
}

.preset-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-btn.active {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.preset-preview {
    font-weight: bold;
    font-size: 1.25rem;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.preset-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.preset-description {
    font-size: 0.625rem;
    color: #6b7280;
    line-height: 1.2;
}

/* CSS Output Styling */
.css-output-container {
    background: #0f172a;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    position: relative;
}

.css-code {
    color: #e2e8f0;
    font-family: "Fira Code", "Monaco", "Cascadia Code", "Roboto Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}

/* CSS Syntax Highlighting */
.css-code .selector {
    color: #fbbf24;
}

.css-code .property {
    color: #60a5fa;
}

.css-code .value {
    color: #34d399;
}

/* Performance Indicators */
.performance-score {
    transition: all 0.3s ease;
}

.performance-score.excellent {
    color: #10b981;
}

.performance-score.good {
    color: #f59e0b;
}

.performance-score.fair {
    color: #f97316;
}

.performance-score.poor {
    color: #ef4444;
}

/* Browser Icons */
.browser-icon {
    transition: all 0.2s ease;
}

.browser-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.browser-icon.supported {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.browser-icon.partial {
    background: #fffbeb;
    border-color: #fed7aa;
}

.browser-icon.unsupported {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Accessibility Tips */
.accessibility-tip {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #0369a1;
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .control-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .range-input-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .range-value {
        text-align: center;
        min-width: auto;
    }

    .preset-btn {
        min-height: 80px;
        padding: 0.75rem;
    }

    .css-code {
        font-size: 0.75rem;
    }

    #previewElement {
        font-size: 2rem !important;
        padding: 1rem;
        text-align: center;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .shadow-layer-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .layer-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .bg-pattern-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .css-output-container {
        padding: 1rem;
    }
}

/* Focus Styles for Accessibility */
.control-input:focus,
.preset-btn:focus,
.layer-action-btn:focus,
.bg-pattern-btn:focus,
button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .shadow-layer {
        border-width: 3px;
    }

    .preset-btn {
        border-width: 3px;
    }

    .control-input[type="range"]::-webkit-slider-thumb {
        border-width: 3px;
        border-color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
