/* --- Controls Styling --- */
.controls-container {
    background: #ffffff;
    padding: 10px 25px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    gap: 30px;
    align-items: center;
    margin-top: 15px;
}

.checkbox-label {
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Grid & Canvas --- */
.molecule-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.mol-card {
    width: 100%;
    height: 100%;
}

.mol-canvas {
    width: 100%;
    height: 100%;
}

.mol-card {
    background: #eaeaea;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    /* Context for absolute positioning if needed */
}

.mol-card .molTitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    font-size: 110%;
    text-align: center;
}

.mol-canvas {
    width: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    /* Ensures controls don't spill out */
}

.mol-card,
.mol-canvas {
    border: 1px solid #DEDEDE;
}

/* --- Canvas Overlay Controls (New) --- */
.canvas-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
    /* Ensure it sits on top of the canvas */
}

/* Show controls when hovering the Card */
.mol-card:hover .canvas-overlay {
    opacity: 1;
}

.overlay-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    color: #333;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.overlay-btn:hover {
    background: #fff;
    color: #3050F8;
}

/* Fix for Fullscreen visibility */
.mol-canvas:fullscreen {
    width: 100vw;
    height: 100vh;
    border: none;
    border-radius: 0;
}

.mol-canvas:fullscreen .canvas-overlay {
    opacity: 1;
    /* Always show controls in fullscreen mode */
    bottom: 20px;
    right: 20px;
}

/* --- Browser Grid Specific --- */
.browser-grid-item .canvas-overlay {
    display: none !important;
}