/* URDF Carousel Viewer Styles */

.urdf-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 60px;
}

.urdf-viewer-grid {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.urdf-viewer-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    gap: 20px;
}

.urdf-viewer-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.viewer-canvas {
    flex: 1;
    min-width: 0;
    min-height: 400px;
    height: 100%;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.viewer-canvas canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.viewer-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    max-width: 300px;
    backdrop-filter: blur(10px);
    z-index: 5;
    pointer-events: none;
}

.viewer-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.viewer-info p {
    margin: 0;
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
}

.viewer-controls {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.viewer-controls h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.joint-controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.joint-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.joint-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.joint-value {
    font-size: 12px;
    color: #4CAF50;
    font-weight: 600;
}

.joint-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.joint-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.joint-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.joint-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #4CAF50;
    color: white;
    border: 2px solid white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.carousel-nav:hover {
    background: #45a049;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.carousel-indicators .indicator:hover {
    background: #999;
    transform: scale(1.2);
}

.carousel-indicators .indicator.active {
    background: #4CAF50;
    transform: scale(1.3);
}

/* Scrollbar for controls */
.viewer-controls::-webkit-scrollbar {
    width: 6px;
}

.viewer-controls::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.viewer-controls::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

.viewer-controls::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Responsive Design */
@media (max-width: 768px) {
    .urdf-carousel-container {
        padding: 20px;
    }

    .urdf-viewer-item {
        flex-direction: column;
    }

    .viewer-canvas {
        height: 400px;
    }

    .viewer-controls {
        width: 100%;
        max-height: 300px;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* Loading state */
.viewer-canvas.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
}
