/* Stanford Bunny WebGL Widget Styles */

.stanford-bunny-widget {
    position: relative;
    display: inline-block;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.stanford-bunny-widget:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.stanford-bunny-widget canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Loading state */
.widget-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    text-align: center;
    z-index: 10;
}

.widget-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Disposed state */
.widget-disposed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    text-align: center;
    z-index: 10;
}

/* Responsive widget */
.responsive-widget {
    width: 100%;
    height: 400px;
    min-height: 300px;
    max-width: 800px;
}

@media (max-width: 768px) {
    .responsive-widget {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .responsive-widget {
        height: 250px;
    }
}

/* Demo page specific styles */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.demo-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
    font-size: 2.5em;
}

.demo-container h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.widget-section {
    margin-bottom: 50px;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.widget-section .stanford-bunny-widget {
    margin: 20px auto;
    display: block;
}

/* Controls panel */
.controls-panel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.controls-panel button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.controls-panel button:hover {
    background: #0056b3;
}

.controls-panel button:active {
    transform: scale(0.98);
}

/* Integration examples */
.integration-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.example-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.example-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.example-card p {
    color: #666;
    font-size: 0.9em;
    margin-top: 15px;
    line-height: 1.4;
}

.example-card .stanford-bunny-widget {
    margin: 15px auto;
}

/* Character viewer specific styling */
.character-viewer {
    border: 3px solid #28a745;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.character-viewer:hover {
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}

/* Showcase viewer specific styling */
.showcase-viewer {
    border: 3px solid #17a2b8;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.showcase-viewer:hover {
    box-shadow: 0 6px 18px rgba(23, 162, 184, 0.4);
}

/* Widget error state */
.widget-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc3545;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    text-align: center;
    z-index: 10;
}

.widget-error::before {
    content: '⚠️';
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Accessibility */
.stanford-bunny-widget:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.stanford-bunny-widget[aria-label] {
    cursor: pointer;
}

/* Print styles */
@media print {
    .stanford-bunny-widget {
        border: 2px solid #000;
        background: white;
    }

    .widget-loading::after {
        display: none;
    }

    .widget-loading::before {
        content: '[3D Model - Stanford Bunny]';
        font-weight: bold;
    }

    .controls-panel {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .demo-container {
        background: #1a1a1a;
        color: #fff;
    }

    .demo-container h1,
    .demo-container h2 {
        color: #fff;
    }

    .widget-section {
        background: #2a2a2a;
        color: #fff;
    }

    .example-card {
        background: #333;
        border-color: #555;
        color: #fff;
    }

    .example-card h3 {
        color: #fff;
    }

    .example-card p {
        color: #ccc;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .stanford-bunny-widget {
        border: 3px solid #000;
    }

    .widget-loading {
        color: #000;
        background: #fff;
        padding: 10px;
        border-radius: 5px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .stanford-bunny-widget {
        transition: none;
    }

    .widget-loading::after {
        animation: none;
    }

    .controls-panel button {
        transition: none;
    }
}
