/*!
 * Component Preview Styles
 * 
 * Development tool styles for component preview system
 */

/* Preview Layout */
.component-preview-page {
    background: #f8f9fa !important;
}

.component-preview-wrapper {
    position: relative;
    margin: 1rem 0;
    padding: 1rem;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
}

.component-preview-wrapper::before {
    content: "Preview";
    position: absolute;
    top: -12px;
    left: 10px;
    background: #f8f9fa;
    padding: 0 8px;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.component-preview-wrapper.variation-large::before {
    content: "Large Variation";
}

.component-preview-wrapper.variation-small::before {
    content: "Small Variation";
}

.component-preview-wrapper.variation-minimal::before {
    content: "Minimal Variation";
}

.component-preview-wrapper.variation-cards::before {
    content: "Cards Variation";
}

.component-preview-wrapper.variation-horizontal::before {
    content: "Horizontal Layout";
}

.component-preview-wrapper.variation-vertical::before {
    content: "Vertical Layout";
}

/* Preview Controls */
.preview-toolbar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1050;
}

.preview-toolbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f8f9fa;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preview-toolbar-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.preview-toolbar-btn.active {
    background: #007bff;
    color: #fff;
}

/* Responsive Preview */
.preview-responsive-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.responsive-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.responsive-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.preview-viewport {
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.preview-viewport.desktop {
    width: 100%;
}

.preview-viewport.tablet {
    width: 768px;
}

.preview-viewport.mobile {
    width: 375px;
}

/* Component Variants */
.variant-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.variant-switcher label {
    font-weight: 600;
    margin-right: 1rem;
    color: #495057;
}

/* Code Display */
.code-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.5rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 10;
}

.code-preview pre {
    max-height: 400px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Animation Controls */
.animation-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.animation-play-btn {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

.animation-speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.animation-speed-control input[type="range"] {
    width: 100px;
}

/* Accessibility Indicators */
.accessibility-indicator {
    position: absolute;
    top: -8px;
    right: 10px;
    background: #28a745;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.accessibility-indicator.warning {
    background: #ffc107;
    color: #212529;
}

.accessibility-indicator.error {
    background: #dc3545;
}

/* Theme Variations */
.theme-variation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.theme-variation-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.theme-variation-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
}

.theme-variation-btn.dark {
    border-color: #343a40;
    background: #343a40;
    color: #fff;
}

.theme-variation-btn.light {
    border-color: #f8f9fa;
    background: #f8f9fa;
    color: #212529;
}

/* Interactive State Toggles */
.state-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.state-toggle {
    appearance: none;
    position: relative;
    width: 44px;
    height: 24px;
    background: #ced4da;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.state-toggle:checked {
    background: #007bff;
}

.state-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.state-toggle:checked::before {
    transform: translateX(20px);
}

.state-label {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
}

/* Print Styles */
@media print {
    .preview-toolbar,
    .preview-responsive-controls,
    .variant-switcher,
    .animation-controls,
    .theme-variation-controls,
    .state-controls {
        display: none !important;
    }
    
    .component-preview-wrapper {
        border: 1px solid #dee2e6;
        break-inside: avoid;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .preview-toolbar {
        position: relative;
        bottom: auto;
        right: auto;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        justify-content: center;
    }
    
    .preview-viewport.tablet,
    .preview-viewport.desktop {
        width: 100%;
    }
    
    .variant-switcher,
    .theme-variation-controls,
    .state-controls {
        justify-content: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .component-preview-page {
        background: #1a1a1a !important;
        color: #fff;
    }
    
    .component-preview-wrapper {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .preview-toolbar {
        background: #2d2d2d;
        border: 1px solid #404040;
    }
    
    .preview-toolbar-btn {
        background: #404040;
        color: #fff;
    }
    
    .preview-responsive-controls,
    .variant-switcher,
    .animation-controls,
    .theme-variation-controls,
    .state-controls {
        background: #2d2d2d;
        border: 1px solid #404040;
    }
    
    .responsive-btn,
    .variant-switcher .variation-btn,
    .theme-variation-btn {
        background: #404040;
        color: #fff;
        border-color: #555;
    }
}