/* Box Shadow Generator Custom Styles */

/* Preview Container Styling */
.preview-container {
    position: relative;
    background-image: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f8f9fa 75%), linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    transition: all 0.3s ease;
}

.preview-container.dark-bg {
    background-color: #1f2937;
    background-image: linear-gradient(45deg, #374151 25%, transparent 25%), linear-gradient(-45deg, #374151 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #374151 75%), linear-gradient(-45deg, transparent 75%, #374151 75%);
}

.preview-container.grid-bg {
    background-color: #ffffff;
    background-image: linear-gradient(#e5e7eb 1px, transparent 1px), linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}

.preview-container.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-container.texture-bg {
    background-color: #f3f4f6;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.5) 35px, rgba(255, 255, 255, 0.5) 70px), repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(0, 0, 0, 0.1) 35px, rgba(0, 0, 0, 0.1) 70px);
}

.preview-container.dots-bg {
    background-color: #f9fafb;
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 15px 15px;
}

/* Preview Element */
.preview-element {
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
}

.preview-element:hover {
    transform: scale(1.05);
}

/* 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: #3b82f6;
    transform: scale(1.1);
}

.bg-pattern-btn.active {
    border-color: #3b82f6;
    background-color: #3b82f6;
    color: white;
}

/* Shadow Layer Controls */
.shadow-layer {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    transition: all 0.3s ease;
    position: relative;
}

.shadow-layer:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.shadow-layer.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.shadow-layer-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 12px;
}

.shadow-layer-toggle {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.shadow-layer-actions {
    display: flex;
    gap: 8px;
}

.layer-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.layer-duplicate-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.layer-duplicate-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.layer-delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.layer-delete-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* Control Groups */
.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.control-item {
    flex: 1;
    min-width: 120px;
}

.control-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.control-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.control-input[type="range"] {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.control-input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-input[type="color"] {
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

/* Range Input with Value Display */
.range-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-value {
    min-width: 40px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
}

/* Inset Toggle */
.inset-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-switch.active {
    background: #3b82f6;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Preset Buttons */
.preset-btn {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.preset-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.preset-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.preset-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.preset-description {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.preset-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* CSS Output Styling */
.css-output-container {
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    position: relative;
    overflow-x: auto;
}

.css-code {
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

/* Syntax highlighting */
.css-code .property {
    color: #60a5fa;
}

.css-code .value {
    color: #34d399;
}

.css-code .selector {
    color: #fbbf24;
}

/* Browser Compatibility Icons */
.browser-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 12px;
    font-weight: 500;
}

.browser-icon.supported {
    color: #059669;
    background: #ecfdf5;
}

.browser-icon.partial {
    color: #d97706;
    background: #fffbeb;
}

.browser-icon.unsupported {
    color: #dc2626;
    background: #fef2f2;
}

/* Performance Score Animations */
.performance-score {
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.performance-score.excellent {
    color: #059669;
}

.performance-score.good {
    color: #0891b2;
}

.performance-score.fair {
    color: #d97706;
}

.performance-score.poor {
    color: #dc2626;
}

/* Accessibility Tips */
.accessibility-tip {
    padding: 8px 12px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
}

/* Loading Animation */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        background-color: #10b981;
    }
    50% {
        transform: scale(1.05);
        background-color: #059669;
    }
    100% {
        transform: scale(1);
        background-color: #10b981;
    }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .control-group {
        flex-direction: column;
    }

    .control-item {
        min-width: 100%;
    }

    .range-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .preset-btn {
        text-align: center;
    }

    .shadow-layer-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .shadow-layer-actions {
        justify-content: center;
    }

    .css-output-container {
        font-size: 12px;
        padding: 12px;
    }

    .bg-pattern-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Compact Mode for Small Screens */
@media (max-width: 640px) {
    .preview-container {
        padding: 4rem 2rem;
        min-height: 200px;
    }

    .preview-element {
        width: 80px;
        height: 80px;
        font-size: 12px;
    }

    .control-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .preview-container {
        background-size: 10px 10px;
        background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    }

    .preview-container.grid-bg {
        background-size: 10px 10px;
    }
}

/* Print Styles */
@media print {
    .bg-pattern-btn,
    .layer-action-btn,
    #successMessage {
        display: none;
    }

    .preview-container {
        background: white;
        border: 1px solid #000;
    }

    .css-output-container {
        background: white;
        border: 1px solid #000;
    }

    .css-code {
        color: black;
    }
}
