/**
 * YTHING 4.0 Frontend CSS
 * Responsive styling for the video generation interface
 */

.ything-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ything-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ything-form {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid #e1e5e9;
}

.ything-field-group {
    margin-bottom: 25px;
}

.ything-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.ything-field-group input,
.ything-field-group select,
.ything-field-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ything-field-group input:focus,
.ything-field-group select:focus,
.ything-field-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ything-field-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.ything-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.ything-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.ything-submit-btn:active {
    transform: translateY(0);
}

.ything-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ything-loading {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.ything-loading p {
    margin-top: 15px;
    color: #64748b;
    font-size: 1.1rem;
}

.ything-results {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.ything-results h3 {
    color: #374151;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 700;
}

.ything-scene {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.ything-scene:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.scene-header h4 {
    margin: 0;
    color: #374151;
    font-size: 1.2rem;
    font-weight: 600;
}

.scene-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-generating {
    background: #dbeafe;
    color: #1e40af;
}

.status-ready {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.scene-content {
    margin-top: 15px;
}

.scene-prompt {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    font-style: italic;
    color: #4b5563;
}

.scene-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6b7280;
}

.scene-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ything-generate-image-btn,
.ything-override-prompt-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ything-generate-image-btn:hover,
.ything-override-prompt-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.ything-generate-image-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.ything-override-prompt-btn {
    background: #f59e0b;
}

.ything-override-prompt-btn:hover {
    background: #d97706;
}

.scene-assets {
    margin-top: 15px;
}

.scene-asset {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.generated-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.asset-metadata {
    margin-top: 10px;
    color: #6b7280;
    font-size: 0.85rem;
}

.ything-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    color: #991b1b;
}

.ything-error h4 {
    margin: 0 0 10px 0;
    color: #dc2626;
}

.ything-retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.ything-retry-btn:hover {
    background: #b91c1c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ything-frontend {
        padding: 15px;
    }
    
    .ything-title {
        font-size: 2rem;
    }
    
    .ything-form {
        padding: 20px;
    }
    
    .scene-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .scene-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .scene-actions {
        flex-direction: column;
    }
    
    .ything-generate-image-btn,
    .ything-override-prompt-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ything-title {
        font-size: 1.5rem;
    }
    
    .ything-form {
        padding: 15px;
    }
    
    .ything-submit-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Breakdance Builder Compatibility */
.bd-element .ything-frontend {
    margin: 0;
    padding: 0;
}

.bd-element .ything-frontend .ything-title {
    margin-top: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ything-frontend {
        color: #e5e7eb;
    }
    
    .ything-form,
    .ything-results {
        background: #1f2937;
        border-color: #374151;
    }
    
    .ything-field-group label {
        color: #d1d5db;
    }
    
    .ything-field-group input,
    .ything-field-group select,
    .ything-field-group textarea {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .ything-scene {
        background: #374151;
        border-color: #4b5563;
    }
    
    .scene-prompt {
        background: #1f2937;
        color: #d1d5db;
    }
}

