/* ========================================
   360° Mug Viewer Styles
   Matches purple/magenta theme
   ======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.demo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.demo-container h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

.demo-container > p {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

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

.demo-section h2 {
    color: #8b3a9e;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* ========================================
   Mug Viewer Container
   ======================================== */

.mug-360-viewer {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(139, 58, 158, 0.1);
}

.mug-360-viewer canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
}

.mug-360-viewer canvas:active {
    cursor: grabbing;
}

/* ========================================
   Loading State
   ======================================== */

.mug-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #8b3a9e;
    font-size: 1rem;
    z-index: 10;
}

.mug-viewer-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8b3a9e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* ========================================
   Control Panel
   ======================================== */

.mug-viewer-controls {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    transition: all 0.3s ease;
}

.mug-viewer-controls:hover {
    box-shadow: 0 6px 25px rgba(139, 58, 158, 0.25);
}

/* ========================================
   Control Buttons
   ======================================== */

.mug-control-btn {
    background: #8b3a9e;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 58, 158, 0.3);
}

.mug-control-btn:hover {
    background: #a045b5;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 58, 158, 0.4);
}

.mug-control-btn:active {
    transform: scale(0.95);
}

.mug-control-btn.paused {
    background: #666;
}

.mug-control-btn.paused:hover {
    background: #777;
}

/* Button Icons */
.mug-control-btn::before {
    content: '';
    display: block;
}

.mug-control-btn.play::before {
    content: '▶';
    font-size: 14px;
    margin-left: 2px;
}

.mug-control-btn.pause::before {
    content: '❚❚';
    font-size: 14px;
}

.mug-control-btn.reset::before {
    content: '↻';
    font-size: 20px;
}

/* ========================================
   Speed Slider
   ======================================== */

.mug-speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

.mug-speed-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.mug-speed-slider {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.mug-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b3a9e;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 58, 158, 0.3);
    transition: all 0.2s ease;
}

.mug-speed-slider::-webkit-slider-thumb:hover {
    background: #a045b5;
    transform: scale(1.2);
}

.mug-speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b3a9e;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(139, 58, 158, 0.3);
    transition: all 0.2s ease;
}

.mug-speed-slider::-moz-range-thumb:hover {
    background: #a045b5;
    transform: scale(1.2);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .mug-viewer-controls {
        padding: 12px 15px;
        gap: 10px;
        bottom: -70px;
    }

    .mug-control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .mug-speed-control {
        padding: 0 8px;
    }

    .mug-speed-slider {
        width: 80px;
    }

    .mug-speed-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .mug-viewer-controls {
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 10px;
    }

    .mug-speed-control {
        width: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        padding-top: 10px;
        margin-top: 5px;
        justify-content: center;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.mug-control-btn:focus,
.mug-speed-slider:focus {
    outline: 2px solid #8b3a9e;
    outline-offset: 2px;
}

/* ========================================
   Drag Hint
   ======================================== */

.mug-drag-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(139, 58, 158, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.mug-drag-hint.show {
    opacity: 1;
}

.mug-drag-hint::after {
    content: '👆 Drag to rotate';
}
