/* ============================================
   Интерактивные демо для гайдов
   ============================================ */

.interactive-demo {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.interactive-demo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.interactive-demo-icon {
    font-size: 2rem;
}

.interactive-demo-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.interactive-demo-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

/* Контролы */
.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.demo-control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-control-label {
    font-weight: 600;
    color: #4facfe;
    min-width: 150px;
    font-family: 'Courier New', monospace;
}

.demo-select {
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.demo-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4facfe;
}

.demo-select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.demo-range {
    flex: 1;
    min-width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.demo-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.demo-range-value {
    font-family: 'Courier New', monospace;
    color: #4facfe;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* Превью */
.demo-preview-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    min-height: 200px;
    margin-bottom: 1.5rem;
}

.demo-preview-label {
    font-size: 0.9rem;
    color: #a0a0b0;
    margin-bottom: 1rem;
    font-weight: 600;
}

.demo-preview {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    min-height: 150px;
    transition: all 0.3s ease;
}

.demo-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    transition: all 0.3s ease;
}

.demo-item:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.demo-item:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.demo-item:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Сгенерированный CSS */
.demo-css-output {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.demo-css-label {
    font-size: 0.9rem;
    color: #a0a0b0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.demo-css-code {
    font-family: 'Courier New', monospace;
    color: #4facfe;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.demo-copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.demo-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #4facfe;
}

.demo-copy-btn.copied {
    background: rgba(76, 217, 100, 0.2);
    border-color: #4cd964;
    color: #4cd964;
}

/* Стили для опций выпадающего списка */
.demo-select option {
    background: #1a1a2e !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.95rem !important;
}

.demo-select option:hover {
    background: #2d2d44 !important;
    color: #4facfe !important;
}

.demo-select option:checked {
    background: #4facfe !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .demo-control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .demo-control-label {
        min-width: auto;
    }
    
    .demo-select {
        width: 100%;
    }
    
    .demo-preview {
        flex-wrap: wrap;
    }
    
    .demo-item {
        flex: 1 1 calc(50% - 10px);
    }
}


/* Live Preview стили */
.live-preview {
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.live-preview-title {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

.preview-content {
    background: #ffffff;
    padding: 2rem;
    color: #333333;
    min-height: 100px;
}

/* Переопределяем цвета для Typography примеров */
.preview-content div[style*="color: #ffffff"],
.preview-content div[style*="color:white"],
.preview-content div[style*="color: white"] {
    color: #333333 !important;
}

/* Для Positioning и Animations — оставляем тёмный фон */
.preview-content[style*="background: #1a1a2e"],
.preview-content[style*="background: rgba(0, 0, 0"],
.preview-content[style*="background: linear-gradient"] {
    color: #ffffff;
}