/* Estilos base para el tablero 3D y panel lateral */
.wp-3d-tabletop-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
}

.wp-3d-tabletop-container * {
    box-sizing: border-box;
}

/* Pantalla de carga */
.wp-3d-tabletop-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.wp-3d-tabletop-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: wp-3d-tabletop-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes wp-3d-tabletop-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Canvas y contenedor */
.wp-3d-tabletop-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 1;
}

.wp-3d-tabletop-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Sidebar base */
.wp-3d-tabletop-sidebar {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 250px !important;
    height: 100% !important;
    background: rgba(25, 30, 45, 0.95) !important;
    z-index: 2000 !important;
    transform: translateX(100%) !important; /* Oculto por defecto */
    transition: transform 0.3s ease !important;
    overflow-y: auto !important;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.4) !important;
}

/* Estado visible del sidebar */
.wp-3d-tabletop-sidebar.visible {
    transform: translateX(0) !important;
}

.wp-3d-tabletop-sidebar-content {
    padding: 15px;
}

/* Mejora para secciones del panel */
.wp-3d-tabletop-sidebar h3 {
    color: #fff !important;
    border-bottom: 1px solid rgba(100, 150, 255, 0.3) !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
}

/* Mejorar el comportamiento del botón del panel */
.wp-3d-panel-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1010;
    background-color: rgba(40, 60, 100, 0.9);
    color: white;
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease; /* Solo transición para la propiedad right */
}

/* Posición específica cuando el panel está visible */
.wp-3d-panel-toggle.panel-visible {
    right: 260px !important; /* Colocar a la izquierda del panel (250px + 10px de margen) */
    transition: right 0.3s ease !important; /* Añadir transición suave */
}

.wp-3d-panel-toggle:hover {
    background-color: rgba(60, 80, 130, 0.9) !important;
}

/* Panel de miniaturas y obstáculos */
.wp-3d-tabletop-panel {
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    overflow: hidden;
    color: black; /* Asegurar que todo el texto dentro del panel sea negro */
}

.wp-3d-tabletop-panel h4 {
    margin: 0;
    padding: 10px 15px;
    background: #f1f1f1;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 600;
}

.wp-3d-tabletop-panel > div {
    padding: 10px;
}

/* Listas de miniaturas y obstáculos */
.wp-3d-tabletop-miniatures-list,
.wp-3d-tabletop-obstacles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

/* Mejorar visualización de las miniaturas y obstáculos en el panel */
.wp-3d-tabletop-miniature-item,
.wp-3d-tabletop-obstacle-item {
    background-color: rgba(40, 50, 70, 0.7) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    border: 1px solid rgba(100, 150, 255, 0.2) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.wp-3d-tabletop-miniature-item:hover,
.wp-3d-tabletop-obstacle-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(100, 150, 255, 0.4) !important;
}

/* Mensajes de estado y notificaciones */
#wp-3d-tabletop-status-message {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 10px 15px;
    background: rgba(40, 50, 70, 0.9);
    color: white;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 150, 255, 0.3);
    transition: all 0.3s ease;
}

.wp-3d-tabletop-miniature-thumb,
.wp-3d-tabletop-obstacle-thumb {
    width: 100%;
    height: 50px;
    background-size: cover;
    background-position: center;
}

/* Cambiar el color del texto para las miniaturas y obstáculos */
.wp-3d-tabletop-miniature-name,
.wp-3d-tabletop-obstacle-name {
    padding: 3px;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: black; /* Cambiar de white a black */
    margin-top: 5px;
    display: block; /* Asegurar que ocupa todo el ancho disponible */
}

/* Añadir estilo específico para el texto en los controles visuales */
.wp-3d-tabletop-visual-controls label,
.wp-3d-tabletop-controls label {
    color: black; /* Asegurar que el texto de las opciones sea negro */
}

/* Barra de herramientas */
.wp-3d-tabletop-toolbar {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 5px;
    display: flex;
    gap: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

/* CORRECCIÓN: Botones adicionales en la barra de herramientas */
.wp-3d-tabletop-additional-toolbar {
    position: absolute;
    top: 60px; /* Debajo de la barra principal */
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Botones específicos para acciones de cronista */
.wp-3d-tabletop-reset-fog-btn,
.wp-3d-tabletop-remove-all-miniatures-btn,
.wp-3d-tabletop-remove-all-obstacles-btn {
    background-color: rgba(60, 80, 120, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    min-width: 140px;
    text-align: center;
}

.wp-3d-tabletop-reset-fog-btn:hover,
.wp-3d-tabletop-remove-all-miniatures-btn:hover,
.wp-3d-tabletop-remove-all-obstacles-btn:hover {
    background-color: rgba(80, 100, 160, 0.9);
}

.wp-3d-tabletop-reset-fog-btn {
    background-color: rgba(80, 100, 160, 0.9) !important;
}

.wp-3d-tabletop-remove-all-miniatures-btn,
.wp-3d-tabletop-remove-all-obstacles-btn {
    background-color: rgba(180, 80, 80, 0.9) !important;
}

.wp-3d-tabletop-remove-all-miniatures-btn:hover,
.wp-3d-tabletop-remove-all-obstacles-btn:hover {
    background-color: rgba(220, 70, 70, 0.9) !important;
}

/* Ocultar por defecto para usuarios que no son cronistas */
.wp-3d-tabletop-additional-toolbar.hidden {
    display: none !important;
}

/* Mejorar apariencia de botones */
.wp-3d-tabletop-btn {
    background-color: rgba(60, 80, 120, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wp-3d-tabletop-btn:hover {
    background-color: rgba(80, 100, 160, 0.9);
}

.wp-3d-tabletop-btn span {
    margin-right: 6px;
}

.wp-3d-tabletop-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Tooltips para los botones */
.wp-3d-tabletop-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    margin-bottom: 5px;
    pointer-events: none;
}

/* Toggles para opciones visuales */
.wp-3d-tabletop-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
}

.wp-3d-tabletop-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.wp-3d-tabletop-toggle-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background: #ccc;
    border-radius: 9px;
    margin-right: 8px;
    transition: 0.4s;
}

.wp-3d-tabletop-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
}

.wp-3d-tabletop-toggle input:checked + .wp-3d-tabletop-toggle-slider {
    background: #2196F3;
}

.wp-3d-tabletop-toggle input:checked + .wp-3d-tabletop-toggle-slider:before {
    transform: translateX(16px);
}

/* Panel de información */
.wp-3d-tabletop-info-panel {
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    padding: 10px;
    display: none;
}

.wp-3d-tabletop-info-panel.active {
    display: block;
}

/* Mejorar visibilidad cuando se selecciona un objeto */
.wp-3d-tabletop-selected-details {
    background-color: rgba(40, 45, 60, 0.85);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    color: white;
    border: 1px solid rgba(100, 150, 255, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Mejor contraste para texto y elementos */
.wp-3d-tabletop-selected-name,
.wp-3d-tabletop-selected-type,
.wp-3d-tabletop-selected-position {
    margin-bottom: 6px;
    font-size: 13px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Botón para eliminar objetos */
.wp-3d-tabletop-remove-miniature,
.wp-3d-tabletop-remove-obstacle {
    background-color: rgba(180, 60, 60, 0.9);
}

.wp-3d-tabletop-remove-miniature:hover,
.wp-3d-tabletop-remove-obstacle:hover {
    background-color: rgba(220, 70, 70, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    .wp-3d-tabletop-sidebar {
        position: absolute;
        height: 100%;
        z-index: 20;
    }
    
    .wp-3d-tabletop-sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .wp-3d-tabletop-toolbar {
        margin-right: 0;
        margin-bottom: 10px;
        justify-content: center;
    }
}

/* Etiquetas de nombre para todas las miniaturas */
.wp-3d-tabletop-name-label {
    position: absolute;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    border-radius: 4px;
    user-select: none;
    pointer-events: none;
    text-align: center;
    z-index: 100;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.1s ease, opacity 0.2s ease;
}

/* Estilo específico para etiquetas de Standee */
.wp-3d-tabletop-standee-label {
    background: rgba(40, 40, 80, 0.85);
    border-color: rgba(100, 150, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}


/* Estilo específico para etiquetas de modelos GLTF */
.wp-3d-tabletop-gltf-label {
    background: rgba(40, 60, 40, 0.85);
    border-color: rgba(100, 255, 150, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Estilos para toggles y controles */
.wp-3d-tabletop-controls {
    background-color: rgba(30, 35, 50, 0.8);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Estilos para los nuevos botones de control */
.wp-3d-tabletop-additional-controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wp-3d-tabletop-additional-controls .wp-3d-tabletop-btn {
    text-align: left;
    font-size: 12px;
    padding: 6px 10px;
    background-color: rgba(60, 80, 120, 0.9);
}

.wp-3d-tabletop-reset-fog {
    background-color: rgba(80, 100, 160, 0.9) !important;
}

.wp-3d-tabletop-remove-all-miniatures {
    background-color: rgba(180, 80, 80, 0.9) !important;
}

.wp-3d-tabletop-remove-all-obstacles {
    background-color: rgba(160, 80, 80, 0.9) !important;
}

/* Estilo para filas de toggle con texto a la izquierda y switch a la derecha */
.wp-3d-tabletop-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 5px 0;
}

/* Estilo para el switch */
.wp-3d-tabletop-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.wp-3d-tabletop-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wp-3d-tabletop-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.wp-3d-tabletop-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.wp-3d-tabletop-switch input:checked + .wp-3d-tabletop-switch-slider {
    background-color: #4A80D4;
}

.wp-3d-tabletop-switch input:checked + .wp-3d-tabletop-switch-slider:before {
    transform: translateX(26px);
}

/* Espaciado para los botones adicionales */
.wp-3d-tabletop-additional-controls {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

.wp-3d-tabletop-additional-controls .wp-3d-tabletop-btn {
    width: 100%;
    margin-bottom: 8px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Controles de rotación - SIMPLIFICADOS A 2 BOTONES */
.wp-3d-tabletop-rotation-controls {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(40, 45, 60, 0.85);
    border-radius: 6px;
    border: 1px solid rgba(100, 150, 255, 0.3);
}

.wp-3d-tabletop-rotation-controls strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 13px;
}

/* NUEVO: Contenedor simplificado con solo 2 botones */
.rotation-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    max-width: 200px;
    margin: 0 auto;
}

.rotation-buttons .wp-3d-tabletop-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(60, 80, 120, 0.9);
    border: 1px solid rgba(100, 150, 255, 0.3);
    transition: all 0.2s ease;
    flex: 1;
}

.rotation-buttons .wp-3d-tabletop-btn:hover {
    background-color: rgba(80, 100, 160, 0.9);
    border-color: rgba(100, 150, 255, 0.5);
    transform: translateY(-1px);
}

.rotation-buttons .wp-3d-tabletop-btn .dashicons {
    font-size: 16px;
    margin-right: 4px;
}

/* Información de rotación */
.wp-3d-tabletop-selected-rotation {
    margin-bottom: 8px;
    color: #fff;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive para pantallas pequeñas */
@media (max-width: 768px) {
    .rotation-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .rotation-buttons .wp-3d-tabletop-btn {
        width: 100%;
    }
}