/**
 * Enhanced MMD 3D Viewer CSS
 * Version: 2.3
 */

.enhanced-3d-widget-container {
    position: relative;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.enhanced-3d-viewer {
    position: relative;
    background: #f0f0f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enhanced-3d-viewer canvas {
    display: block !important;
    max-width: 100%;
    max-height: 100%;
}

.enhanced-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-family: Arial, sans-serif;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.enhanced-controls {
    background: #fff;
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enhanced-model-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.enhanced-model-info strong {
    font-size: 16px;
    color: #23282d;
}

.model-type {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.enhanced-animation-controls,
.enhanced-camera-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.enhanced-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.enhanced-btn:hover {
    background: #005177;
}

.enhanced-btn:active {
    background: #004463;
}

.enhanced-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .enhanced-controls {
        padding: 10px;
    }
    
    .enhanced-model-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .enhanced-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* エラー表示 */
.enhanced-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
}

.enhanced-error .error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* フォールバック表示 */
.enhanced-fallback {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-family: Arial, sans-serif;
}

.enhanced-fallback h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.enhanced-fallback p {
    margin: 5px 0;
    font-size: 14px;
}

/* ローディング状態のバリエーション */
.enhanced-3d-viewer.loading {
    pointer-events: none;
}

.enhanced-3d-viewer.error {
    background: #fff5f5;
    border-color: #fed7d7;
}

/* Widget specific styles */
.widget .enhanced-3d-widget-container {
    margin: 10px 0;
}

.widget .enhanced-controls {
    padding: 10px;
}

.widget .enhanced-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Admin specific styles */
.wp-admin .enhanced-3d-widget-container {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Progress bar for loading */
.enhanced-progress {
    width: 100%;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.enhanced-progress-bar {
    height: 100%;
    background: #0073aa;
    transition: width 0.3s ease;
    width: 0%;
}

/* Status indicators */
.enhanced-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.enhanced-status.ready {
    background: #d1e7dd;
    color: #0f5132;
}

.enhanced-status.loading {
    background: #fff3cd;
    color: #664d03;
}

.enhanced-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Accessibility improvements */
.enhanced-btn:focus {
    outline: 2px solid #005177;
    outline-offset: 2px;
}

.enhanced-3d-viewer:focus-within {
    box-shadow: 0 0 0 2px #0073aa;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .enhanced-3d-viewer {
        border: 2px solid;
    }
    
    .enhanced-btn {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border: 4px solid #0073aa;
    }
    
    .enhanced-btn {
        transition: none;
    }
}