/* Tripo3D Frontend Styles */

.tripo3d-generator {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tripo3d-generator * {
    box-sizing: border-box;
}

/* Header */
.tripo3d-header {
    text-align: center;
    margin-bottom: 24px;
}

.tripo3d-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.tripo3d-hint {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Dropzone */
.tripo3d-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tripo3d-dropzone:hover,
.tripo3d-dropzone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.tripo3d-dropzone-content .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.tripo3d-dropzone-content p {
    margin: 0 0 16px 0;
    color: #555;
    font-size: 15px;
}

/* Upload Button */
.tripo3d-upload-btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
    border: none;
}

.tripo3d-upload-btn:hover {
    background: #2563eb;
}

/* File Info */
.tripo3d-file-info {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 16px;
}

/* Preview */
.tripo3d-preview {
    position: relative;
    display: inline-block;
}

.tripo3d-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tripo3d-remove-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.tripo3d-remove-btn:hover {
    transform: scale(1.1);
}

.tripo3d-remove-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Options */
.tripo3d-options {
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

.tripo3d-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.tripo3d-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* Generate Button */
.tripo3d-generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tripo3d-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tripo3d-generate-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tripo3d-generate-btn .spinning {
    animation: tripo3d-spin 1s linear infinite;
}

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

/* Processing Section */
.tripo3d-processing-section {
    text-align: center;
    padding: 40px 20px;
}

.tripo3d-progress {
    margin-bottom: 32px;
}

.tripo3d-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.tripo3d-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.tripo3d-progress-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 3D Cube Animation */
.tripo3d-generation-animation {
    perspective: 600px;
    margin: 48px auto;
}

.tripo3d-cube {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    animation: tripo3d-rotate 4s infinite linear;
    margin: 0 auto;
}

.tripo3d-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.tripo3d-face.front { transform: translateZ(40px); }
.tripo3d-face.back { transform: translateZ(-40px) rotateY(180deg); }
.tripo3d-face.left { transform: rotateY(-90deg) translateZ(40px); }
.tripo3d-face.right { transform: rotateY(90deg) translateZ(40px); }
.tripo3d-face.top { transform: rotateX(90deg) translateZ(40px); }
.tripo3d-face.bottom { transform: rotateX(-90deg) translateZ(40px); }

@keyframes tripo3d-rotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.tripo3d-processing-hint {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 20px;
}

/* Model Viewer */
.tripo3d-model-viewer {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    overflow: hidden;
    padding: 20px;
}

model-viewer {
    width: 100%;
    height: 400px;
    --progress-bar-height: 300px;
    background: transparent;
}

/* Model Actions */
.tripo3d-model-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.tripo3d-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tripo3d-action-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.tripo3d-action-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.tripo3d-secondary-btn {
    background: #f3f4f6;
    color: #374151;
}

.tripo3d-secondary-btn:hover {
    background: #e5e7eb;
}

/* Error Section */
.tripo3d-error-section {
    padding: 40px 20px;
}

.tripo3d-error-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
}

.tripo3d-error-message .dashicons {
    color: #ef4444;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.tripo3d-error-message p {
    margin: 0;
    line-height: 1.5;
}

.tripo3d-retry-btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 24px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tripo3d-retry-btn:hover {
    background: #dc2626;
}

/* Error Message (Static) */
.tripo3d-error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .tripo3d-generator {
        padding: 16px;
        border-radius: 0;
    }

    .tripo3d-dropzone {
        padding: 30px 16px;
        min-height: 200px;
    }

    model-viewer {
        height: 300px;
    }

    .tripo3d-model-actions {
        flex-direction: column;
    }
}