/**
 * SmartWeb Website Previews Styles
 */

/* Preview Loading */
.preview-loading {
    text-align: center;
    padding: 60px 20px;
}

.preview-loading .spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

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

.preview-loading h3 {
    margin-top: 20px;
    color: #333;
    font-size: 1.5em;
}

.preview-loading p {
    color: #666;
    margin-top: 10px;
}

/* Preview Container */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Preview Option */
.preview-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    background: #fff;
}

.preview-option:hover {
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.preview-option.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Preview Header */
.preview-header {
    background: #f9fafb;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.preview-header h3 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 1.3em;
}

.preview-colors {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Preview Content */
.preview-content {
    padding: 25px;
}

.preview-theme {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 20px;
}

.preview-details h4 {
    color: #374151;
    font-size: 0.9em;
    font-weight: 600;
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-details p {
    color: #6b7280;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
}

.preview-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preview-features li {
    color: #6b7280;
    font-size: 0.95em;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.preview-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Preview Footer */
.preview-footer {
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.btn-select-preview {
    width: 100%;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-select-preview:hover {
    background: #5a67d8;
}

.preview-option.selected .btn-select-preview {
    background: #10b981;
}

.preview-option.selected .btn-select-preview:hover {
    background: #059669;
}

/* Preview Error */
.preview-error {
    text-align: center;
    padding: 60px 20px;
    color: #dc2626;
}

.preview-error i {
    font-size: 3em;
    margin-bottom: 20px;
    display: block;
}

.preview-error p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.btn-retry {
    padding: 12px 30px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Form Field Errors */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation for Button */
.btn-generate-preview:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-generate-preview:disabled:after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}