/**
 * JCOGS Image Pro - Live Preview Styles
 * =====================================
 * CSS for the live parameter preview functionality
 * 
 * @category   ExpressionEngine Add-on
 * @package    JCOGS Image Pro
 * @author     JCOGS Design <contact@jcogs.net>
 * @copyright  Copyright (c) 2021 - 2025 JCOGS Design
 * @license    https://jcogs.net/add-ons/license/jcogs_img_pro
 * @version    2.0.6
 * @since      2.0.0
 */

/* Live Preview Panel */
.live-preview-panel {
    margin-top: 2rem;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f7f9fc;
    border-bottom: 1px solid #e1e7ed;
}

.preview-header h4 {
    margin: 0;
    color: #5d6975;
    font-weight: 600;
    font-size: 1.1rem;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.preview-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.preview-controls .btn i {
    font-size: 0.875rem;
}

/* Preview Content Area */
.preview-content {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
}

.preview-placeholder {
    text-align: center;
    color: #8892a4;
    padding: 2rem;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d4dae2;
}

.preview-placeholder p {
    margin: 0;
    font-size: 1rem;
}

/* Preview Image Container */
.preview-image-container {
    position: relative;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
}

#live-preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 0.75rem;
    color: #5d6975;
    font-weight: 500;
}

.preview-loading i {
    color: #1f7dc4;
}

.icon--spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Preview Error State */
.preview-error {
    text-align: center;
    color: #ee5a52;
    padding: 2rem;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.preview-error i {
    font-size: 1.25rem;
}

/* Preview Metadata */
.preview-metadata {
    padding: 1rem 1.5rem;
    background: #f7f9fc;
    border-top: 1px solid #e1e7ed;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metadata-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8892a4;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.metadata-item span {
    font-size: 0.875rem;
    color: #5d6975;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Enhanced Parameter Form Styling */
.parameter-form-section {
    position: relative;
}

.parameter-form-section .form-group {
    margin-bottom: 1.5rem;
}

.parameter-form-section .form-group:last-child {
    margin-bottom: 0;
}

.parameter-form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #5d6975;
}

.parameter-form-section .form-control {
    transition: all 0.2s ease;
    border: 1px solid #d4dae2;
}

.parameter-form-section .form-control:focus {
    border-color: #1f7dc4;
    box-shadow: 0 0 0 3px rgba(31, 125, 196, 0.1);
}

/* Parameter Info Section Enhancement */
.parameter-info-section {
    background: #f7f9fc;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    border: 1px solid #e1e7ed;
}

.parameter-info-section h4 {
    margin: 0 0 1rem 0;
    color: #5d6975;
    font-weight: 600;
}

.parameter-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.parameter-details p {
    margin: 0;
    font-size: 0.875rem;
    color: #5d6975;
}

.parameter-details strong {
    color: #384551;
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

.parameter-details code {
    background: #e8f4ff;
    color: #1f7dc4;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.8125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .preview-controls {
        justify-content: center;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .parameter-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .preview-controls {
        flex-direction: column;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for smooth transitions */
.preview-image-container,
.preview-placeholder,
.preview-error {
    transition: opacity 0.3s ease;
}

/* Enhanced focus states for accessibility */
.preview-controls .btn:focus {
    outline: 2px solid #1f7dc4;
    outline-offset: 2px;
}

/* Loading state animation enhancement */
.preview-loading {
    backdrop-filter: blur(2px);
}

/* Success state styling */
.preview-image-container.loaded #live-preview-image {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
